From 8371a014a00a4ab4632f5fbc09ae64f5b3d1e103 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Thu, 19 Nov 2020 13:47:26 +0100 Subject: [PATCH] fix: restart nginx with systemctl --- scripts/functions.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 3e57619..e1dc100 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -66,8 +66,7 @@ stop_dwc(){ start_moonraker(){ status_msg "Starting Moonraker Service ..." - sudo systemctl start moonraker - ok_msg "Moonraker Service started!" + sudo systemctl start moonraker && ok_msg "Moonraker Service started!" } stop_moonraker(){ @@ -140,9 +139,9 @@ read_octoprint_service_status(){ } restart_nginx(){ - if [ -e /etc/init.d/nginx ]; then + if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "nginx.service")" ]; then status_msg "Restarting Nginx Service ..." - sudo /etc/init.d/nginx restart && sleep 2 && ok_msg "Nginx Service restarted!" + sudo systemctl restart nginx && ok_msg "Nginx Service restarted!" fi }