debmaker/ressources/picapport/rootfs/DEBIAN/postinst
2022-11-19 19:56:01 +01:00

16 lines
380 B
Bash
Executable file

#!/bin/bash
APP=picapport
id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -d /var/lib/${APP}
chown ${APP}:${APP} /var/lib/${APP}/
chown ${APP}:${APP} /var/lib/${APP}/*
if [[ $(systemctl list-unit-files | grep ${APP}.services) -eq 0 ]]
then
systemctl daemon-reload
if [ "$(systemctl is-active ${APP}.service)" != "inactive" ]
then
systemctl restart ${APP}
fi
fi