ServerBot/services.sh

17 lines
267 B
Bash
Raw Permalink Normal View History

2019-05-10 01:30:30 +02:00
#!/bin/bash
function checkServices {
IFS=',' read -r -a array <<< "$1"
result=""
for service in "${array[@]}"
do
res=$(systemctl is-active "$service")
if [ "$res" != "active" ]; then
result="$result $service"
fi
done
echo $result
}