From: Adam Dinwoodie Date: Fri, 29 Jul 2022 06:14:41 +0000 (+0100) Subject: Always skip hooks ending in ~ (#113) X-Git-Tag: v10.0.0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55e3904961f453d65f82f76b591bf8fc71946fce;p=thirdparty%2Fdhcpcd.git Always skip hooks ending in ~ (#113) dhcpcd-run-hooks is intended to skip hooks with filenames ending in `~`, but the test only works if `$skip_hooks` is defined and not empty. Refactor the test such that files ending in `~` are always skipped, as appears to be the intent of this code. --- diff --git a/hooks/dhcpcd-run-hooks.in b/hooks/dhcpcd-run-hooks.in index c858da3b..b0dc2ea5 100644 --- a/hooks/dhcpcd-run-hooks.in +++ b/hooks/dhcpcd-run-hooks.in @@ -338,9 +338,11 @@ for hook in \ @HOOKDIR@/* \ @SYSCONFDIR@/dhcpcd.exit-hook do + case "$hook" in + */*~) continue;; + esac for skip in $skip_hooks; do case "$hook" in - */*~) continue 2;; */"$skip") continue 2;; */[0-9][0-9]"-$skip") continue 2;; */[0-9][0-9]"-$skip.sh") continue 2;;