Skip to content

Commit 515d037

Browse files
authored
Merge branch 'master' into threeway_pacdiff
2 parents dc6d6dc + b47a590 commit 515d037

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

admin/checkservices

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,19 @@ main() {
311311
# from now, we need to be root
312312
(( UID != 0 )) && error 'You need to be root' && exit 1
313313

314-
# call pacdiff to ensure config files are updated before restart
314+
# call pacdiff unless explicitly disabled to ensure config files are updated before restart
315315
if (( PACDIFF )); then
316-
arrow 'Run pacdiff'
317-
if (( THREEWAY )); then
318-
pacdiff --threeway
319-
else
320-
pacdiff
321-
fi
322-
fi
316+
if command -v pacdiff &> /dev/null ; then
317+
arrow 'Run pacdiff'
318+
if (( THREEWAY )); then
319+
pacdiff --threeway
320+
else
321+
pacdiff
322+
fi
323+
else
324+
warn 'skipping pacdiff as not installed'
325+
fi
326+
fi
323327

324328
# ensure systemd has been reloaded or reexectued
325329
(( RELOAD )) && reload_systemd
@@ -363,12 +367,6 @@ main() {
363367
fi
364368
}
365369

366-
# disable pacdiff by default if not installed
367-
if ! command -v pacdiff &> /dev/null ; then
368-
warn 'skipping pacdiff as not installed'
369-
PACDIFF=0
370-
fi
371-
372370
main "$@"
373371

374372
exit 0

0 commit comments

Comments
 (0)