From 85026a5e7f758b84e7b3989236e65e4823a284c4 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 12 Feb 2024 13:03:18 +0100 Subject: [PATCH] Fix incorrect command in check-systemctl-service.sh The commit fixes a bug in the check-systemctl-service.sh script where the wrong command was being used to list units. The correct command, "systemctl ${user} list-units", is now used instead of "systemctl ${user} list-unit-files". This ensures that the script accurately checks for active services. --- check-systemctl-service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-systemctl-service.sh b/check-systemctl-service.sh index cd468d4..7c2811d 100644 --- a/check-systemctl-service.sh +++ b/check-systemctl-service.sh @@ -78,7 +78,7 @@ script_name=$(basename "${0}") script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) GetOptions "$@" -if [[ $(systemctl ${user} list-unit-files "${service}*" | wc -l) -gt 3 ]]; then +if [[ $(systemctl ${user} list-units "${service}*" | wc -l) -gt 3 ]]; then result=$(systemctl ${user} is-active ${service}) else result='inexistent'