debmaker/ressources/mealie/rootfs-frontend/DEBIAN/postinst

20 lines
551 B
Plaintext
Raw Normal View History

2022-11-19 19:56:01 +01:00
#!/bin/bash
APP=mealie-frontend
HOMEDIR=/var/lib/mealie/frontend
[ -d ${HOMEDIR} ] || mkdir -p ${HOMEDIR}
id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -d ${HOMEDIR}
chown ${APP}:${APP} ${HOMEDIR}
systemctl | grep ${APP} | grep -q running && systemctl daemon-reload && systemctl restart ${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