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:
parent
2502f8c817
commit
85026a5e7f
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user