From fe4625d3e19198ccf42e82eca6db8267daa8369f Mon Sep 17 00:00:00 2001 From: th33xitus Date: Thu, 11 Nov 2021 13:21:57 +0100 Subject: [PATCH] chore: refactor how moonraker is detected --- scripts/install_klipper_webui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_klipper_webui.sh b/scripts/install_klipper_webui.sh index 87cb486..7934b83 100755 --- a/scripts/install_klipper_webui.sh +++ b/scripts/install_klipper_webui.sh @@ -1,13 +1,13 @@ system_check_webui(){ ### check system for installed moonraker service - if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "moonraker.service")" ] || [ "$(systemctl list-units --full -all -t service --no-legend | grep -E "moonraker-[[:digit:]].service")" ]; then + if ls /etc/systemd/system/moonraker.service 2>/dev/null || ls /etc/systemd/system | grep -q -E "moonraker-[[:digit:]]+.service"; then moonraker_chk_ok="true" else moonraker_chk_ok="false" fi ### check system for an installed and enabled octoprint service - if systemctl list-unit-files | grep -E "octoprint.*" | grep "enabled" &>/dev/null; then + if sudo systemctl list-unit-files | grep -E "octoprint.*" | grep "enabled" &>/dev/null; then OCTOPRINT_ENABLED="true" fi