check if service is running before trying to start it

This commit is contained in:
m0duspwnens
2024-10-15 11:46:09 -04:00
parent ac6637c6ab
commit c46fb7e74c

View File

@@ -1081,9 +1081,12 @@ apply_hotfix() {
} }
failed_soup_restore_items() { failed_soup_restore_items() {
systemctl_func "start" "$cron_service_name" local services=("$cron_service_name", "salt-master", "salt-minion")
systemctl_func "start" "salt-master" for SERVICE_NAME in "${services[@]}"; do
systemctl_func "start" "salt-minion" if ! systemctl is-active --quiet "$SERVICE_NAME"; then
systemctl_func "start" "$SERVICE_NAME"
fi
done
enable_highstate enable_highstate
masterunlock masterunlock
} }