fix: restart nginx with systemctl

This commit is contained in:
th33xitus
2020-11-19 13:47:26 +01:00
parent 90af76402b
commit 8371a014a0

View File

@@ -66,8 +66,7 @@ stop_dwc(){
start_moonraker(){ start_moonraker(){
status_msg "Starting Moonraker Service ..." status_msg "Starting Moonraker Service ..."
sudo systemctl start moonraker sudo systemctl start moonraker && ok_msg "Moonraker Service started!"
ok_msg "Moonraker Service started!"
} }
stop_moonraker(){ stop_moonraker(){
@@ -140,9 +139,9 @@ read_octoprint_service_status(){
} }
restart_nginx(){ 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 ..." 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 fi
} }