Skip to content

Commit b47a590

Browse files
authored
Merge pull request #97 from uggedal/checkservices-no-pacdiff-warn-when-explicitly-disabled
checkservices: do not warn about missing pacdiff when explicitly disabled with -P
2 parents 00892ab + 6dd25f7 commit b47a590

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

admin/checkservices

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,14 @@ main() {
308308
# from now, we need to be root
309309
(( UID != 0 )) && error 'You need to be root' && exit 1
310310

311-
# call pacdiff to ensure config files are updated before restart
311+
# call pacdiff unless explicitly disabled to ensure config files are updated before restart
312312
if (( PACDIFF )); then
313-
arrow 'Run pacdiff'
314-
pacdiff
313+
if command -v pacdiff &> /dev/null ; then
314+
arrow 'Run pacdiff'
315+
pacdiff
316+
else
317+
warn 'skipping pacdiff as not installed'
318+
fi
315319
fi
316320

317321
# ensure systemd has been reloaded or reexectued
@@ -356,12 +360,6 @@ main() {
356360
fi
357361
}
358362

359-
# disable pacdiff by default if not installed
360-
if ! command -v pacdiff &> /dev/null ; then
361-
warn 'skipping pacdiff as not installed'
362-
PACDIFF=0
363-
fi
364-
365363
main "$@"
366364

367365
exit 0

0 commit comments

Comments
 (0)