]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Always skip hooks ending in ~ (#113)
authorAdam Dinwoodie <me-and@users.noreply.github.com>
Fri, 29 Jul 2022 06:14:41 +0000 (07:14 +0100)
committerGitHub <noreply@github.com>
Fri, 29 Jul 2022 06:14:41 +0000 (07:14 +0100)
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.

hooks/dhcpcd-run-hooks.in

index c858da3b3988e95ae16b25506a1949924294381d..b0dc2ea51a24c0dc5cf1c4d2c783f307226d241c 100644 (file)
@@ -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;;