From 4c34245da05c780557bb4c8fde4b0c9bd53b40f0 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Thu, 11 Nov 2021 12:12:43 +0100 Subject: [PATCH] chore: refactor how klipper services are count --- scripts/install_moonraker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_moonraker.sh b/scripts/install_moonraker.sh index b6d2d75..d0bf9f5 100755 --- a/scripts/install_moonraker.sh +++ b/scripts/install_moonraker.sh @@ -45,10 +45,10 @@ moonraker_setup_dialog(){ shopt -u extglob # disable extended globbing ### count amount of klipper services - if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then + if ls /etc/systemd/system/klipper.service 2>/dev/null; then INSTANCE_COUNT=1 else - INSTANCE_COUNT=$(systemctl list-units --full -all -t service --no-legend | grep -E "klipper-[[:digit:]]+.service" | wc -l) + INSTANCE_COUNT=$(ls /etc/systemd/system | grep -E "klipper-[[:digit:]]+.service" | wc -l) fi ### initial moonraker.conf path check