From 7224040f8a030a5e8214e3daab0c80df550f4e02 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Thu, 28 Jan 2021 23:41:54 +0100 Subject: [PATCH] fix: check for multiple installed and enabled octoprint services --- scripts/install_moonraker.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install_moonraker.sh b/scripts/install_moonraker.sh index ffc0f1d..900b9b3 100755 --- a/scripts/install_moonraker.sh +++ b/scripts/install_moonraker.sh @@ -16,8 +16,8 @@ system_check_moonraker(){ py_chk_ok="false" fi - ### check system for an installed octoprint service - if systemctl is-enabled octoprint.service -q 2>/dev/null; then + ### check system for an installed and enabled octoprint service + if systemctl list-unit-files | grep -E "octoprint.*" | grep "enabled" &>/dev/null; then OCTOPRINT_ENABLED="true" fi @@ -487,9 +487,9 @@ process_octoprint_dialog(){ Y|y|Yes|yes|"") echo -e "###### > Yes" status_msg "Stopping OctoPrint ..." - sudo systemctl stop octoprint && ok_msg "OctoPrint service stopped!" + octoprint_service "stop" && ok_msg "OctoPrint service stopped!" status_msg "Disabling OctoPrint ..." - sudo systemctl disable octoprint && ok_msg "OctoPrint service disabled!" + octoprint_service "disable" && ok_msg "OctoPrint service disabled!" break;; N|n|No|no) echo -e "###### > No"