2022-10-31 16:26:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
APP=picapport
|
|
|
|
|
2023-09-02 22:51:34 +02:00
|
|
|
id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -md /var/lib/${APP}
|
2022-10-31 16:26:17 +01:00
|
|
|
|
2023-09-02 22:51:34 +02:00
|
|
|
chown -R ${APP}:${APP} /var/lib/${APP}/
|
2022-10-31 16:26:17 +01:00
|
|
|
|
2022-11-19 19:56:01 +01:00
|
|
|
if [[ $(systemctl list-unit-files | grep ${APP}.services) -eq 0 ]]
|
|
|
|
then
|
|
|
|
systemctl daemon-reload
|
|
|
|
if [ "$(systemctl is-active ${APP}.service)" != "inactive" ]
|
|
|
|
then
|
2022-10-31 16:26:17 +01:00
|
|
|
systemctl restart ${APP}
|
|
|
|
fi
|
|
|
|
fi
|