debmaker/ressources/picapport/rootfs/DEBIAN/postinst

17 lines
387 B
Plaintext
Raw Normal View History

2022-10-31 16:26:17 +01:00
#!/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 picapport.services) -eq 0 ]]
then
systemctl daemon-reload
if [ "$(systemctl is-active ${APP}.service)" != "inactive" ]
then
systemctl restart ${APP}
fi
fi