From 1f40686ea12d170e0cddd3ee858c40461d3f68ed Mon Sep 17 00:00:00 2001 From: th33xitus Date: Fri, 24 Dec 2021 22:50:50 +0100 Subject: [PATCH] fix: improve moonraker service detection (fixes #156) --- scripts/ms_theme_installer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ms_theme_installer.sh b/scripts/ms_theme_installer.sh index 424de8e..9a7737d 100755 --- a/scripts/ms_theme_installer.sh +++ b/scripts/ms_theme_installer.sh @@ -71,8 +71,8 @@ check_select_printer(){ ### check if there is more than one moonraker instance and if yes ### ask the user to select the printer he wants to install/remove the theme - printer_count=$(ls /etc/systemd/system/moonraker*.service | wc -l) - if [ $printer_count -gt 1 ]; then + MR_SERVICE_COUNT=$(find "$SYSTEMDDIR" -regextype posix-extended -regex "$SYSTEMDDIR/moonraker(-[^0])?[0-9]*.service" | wc -l) + if [[ $MR_SERVICE_COUNT -gt 1 ]]; then top_border echo -e "| More than one printer was found on this system! | " echo -e "| Please select the printer to which you want to | "