You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/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
|
|
}
|
|
|