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.
This commit is contained in:
Jeroen De Meerleer 2024-02-12 13:03:18 +01:00
parent 2502f8c817
commit 85026a5e7f
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 1 additions and 1 deletions

View File

@ -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'