From 49b7fe395be4ff23a47230287adcca1ce11e0cc4 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 31 Jan 2021 18:34:05 +0100 Subject: [PATCH] fix: detect an existing "legacy" klipper init.d installation --- scripts/status.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/status.sh b/scripts/status.sh index 30709ad..36f87df 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -21,6 +21,11 @@ klipper_status(){ ### count amount of klipper service files in /etc/systemd/system SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "klipper" | wc -l) + ### a fix to detect an existing "legacy" klipper init.d installation + if [ -f /etc/init.d/klipper ] && [ -f /etc/init.d/klipper ]; then + SERVICE_FILE_COUNT=1 + fi + ### remove the "SERVICE" entry from the klipper_data array if a klipper service is installed [ $SERVICE_FILE_COUNT -gt 0 ] && unset klipper_data[0]