Fix OctoPrint toggle function

This commit is contained in:
th33xitus
2020-07-16 16:33:44 +02:00
parent fd71b0ee62
commit d19c4d33cb

View File

@@ -229,14 +229,18 @@ disable_octoprint_service(){
} }
toggle_octoprint_service(){ toggle_octoprint_service(){
if systemctl is-enabled octoprint.service -q; then if [[ -f $OCTOPRINT_SERVICE1 && -f $OCTOPRINT_SERVICE2 ]]; then
disable_octoprint_service if systemctl is-enabled octoprint.service -q; then
sleep 2 disable_octoprint_service
CONFIRM_MSG=" OctoPrint Service is now >>> DISABLED <<< !" sleep 2
CONFIRM_MSG=" OctoPrint Service is now >>> DISABLED <<< !"
else
enable_octoprint_service
sleep 2
CONFIRM_MSG=" OctoPrint Service is now >>> ENABLED <<< !"
fi
else else
enable_octoprint_service ERROR_MSG=" You cannot activate a service that does not exist!"
sleep 2
CONFIRM_MSG=" OctoPrint Service is now >>> ENABLED <<< !"
fi fi
} }