linux - systemd support

This commit is contained in:
bunkerity
2021-08-16 15:21:44 +02:00
parent 57e4247eab
commit 2b3b4a5c3f
8 changed files with 64 additions and 19 deletions

View File

@@ -40,13 +40,14 @@ echo "[*] Run jobs"
do_and_check_cmd "/opt/bunkerized-nginx/entrypoint/jobs.sh"
# Reload nginx if it's running
if [ -f "/tmp/nginx.pid" ] ; then
status="$(systemctl status nginx 2>&1)"
if [ $? -eq 0 ] ; then
echo "[*] Reload nginx"
AS_ROOT="yes" do_and_check_cmd nginx -s reload
AS_ROOT="yes" do_and_check_cmd systemctl reload nginx
# Otherwise start it
else
echo "[*] Start nginx"
AS_ROOT="yes" do_and_check_cmd nginx -g 'daemon on; user nginx;'
AS_ROOT="yes" do_and_check_cmd systemctl start nginx
fi
# Done