Skip to content

Commit

Permalink
Merge pull request #64 from uggedal/checkservices-honor-restart-flag
Browse files Browse the repository at this point in the history
checkservices: honor -R flag
  • Loading branch information
Antiz96 authored Jul 20, 2024
2 parents 55e6f07 + 78d21ec commit fde69ba
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions admin/checkservices
Original file line number Diff line number Diff line change
Expand Up @@ -313,21 +313,29 @@ main() {
local -a broken_services=($(get_broken_maps))
echo "Found: ${#broken_services[@]}"
if (( ${#broken_services[@]} )); then
display_restart "${broken_services[@]}"
if confirm 'Execute?'; then
arrow 'Restart broken services'
restart_services "${broken_services[@]}"
if (( RESTART )); then
display_restart "${broken_services[@]}"
if confirm 'Execute?'; then
arrow 'Restart broken services'
restart_services "${broken_services[@]}"
fi
else
display_restart "${broken_services[@]}" | sed "s/systemctl restart //g"
fi
fi

arrow 'Services missing on the system bus'
local -a missing_services=($(get_missing_dbus))
echo "Found: ${#missing_services[@]}"
if (( ${#missing_services[@]} )); then
display_restart "${missing_services[@]}"
if confirm 'Execute?'; then
arrow 'Restart missing services'
restart_services "${missing_services[@]}"
if (( RESTART )); then
display_restart "${missing_services[@]}"
if confirm 'Execute?'; then
arrow 'Restart missing services'
restart_services "${missing_services[@]}"
fi
else
display_restart "${missing_services[@]}" | sed "s/systemctl restart //g"
fi
fi

Expand Down

0 comments on commit fde69ba

Please sign in to comment.