debmaker/ressources/babybuddy/rootfs/DEBIAN/postinst

20 lines
477 B
Text
Raw Normal View History

2023-05-01 00:17:30 +02:00
#!/bin/bash
2023-11-02 09:37:18 +01:00
APP=babybuddy
id $APP &> /dev/null || useradd $APP -r -s /bin/false -md /var/lib/$APP/
chown -R $APP:$APP /var/lib/$APP/
2023-05-01 00:17:30 +02:00
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
2023-11-02 09:37:18 +01:00