Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkservices: honor -R flag #64

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions admin/checkservices
Original file line number Diff line number Diff line change
Expand Up @@ -297,21 +297,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