17 lines
267 B
Bash
17 lines
267 B
Bash
|
#!/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
|
||
|
}
|
||
|
|