Add budybase

This commit is contained in:
thomas 2023-05-01 00:17:30 +02:00
parent dbef6baf09
commit f6f7521ffe
20 changed files with 122 additions and 12 deletions

View file

@ -0,0 +1,19 @@
#!/bin/bash
APP=babybuddy
HOMEDIR=/var/lib/babybuddy/
[ -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