]> git.feebdaed.xyz Git - 0xmirror/pi-hole.git/commitdiff
Don't use hard-coded path for pihole user `nologin` shell
authorMichael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
Wed, 30 Jul 2025 19:32:39 +0000 (12:32 -0700)
committerMichael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
Sat, 16 Aug 2025 21:47:57 +0000 (21:47 +0000)
Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
automated install/basic-install.sh

index 5daf26226e4286757ec3be94d6143406227a1400..d2871ec8f0a35861729084c5c590eee4099ea735 100755 (executable)
@@ -1554,7 +1554,7 @@ create_pihole_user() {
             # then create and add her to the pihole group
             local str="Creating user 'pihole'"
             printf "%b  %b %s..." "${OVER}" "${INFO}" "${str}"
-            if useradd -r --no-user-group -g pihole -s /usr/sbin/nologin pihole; then
+            if useradd -r --no-user-group -g pihole -s "$(command -v nologin)" pihole; then
                 printf "%b  %b %s\\n" "${OVER}" "${TICK}" "${str}"
             else
                 printf "%b  %b %s\\n" "${OVER}" "${CROSS}" "${str}"
@@ -1569,7 +1569,7 @@ create_pihole_user() {
                 # create and add pihole user to the pihole group
                 local str="Creating user 'pihole'"
                 printf "%b  %b %s..." "${OVER}" "${INFO}" "${str}"
-                if useradd -r --no-user-group -g pihole -s /usr/sbin/nologin pihole; then
+                if useradd -r --no-user-group -g pihole -s "$(command -v nologin)" pihole; then
                     printf "%b  %b %s\\n" "${OVER}" "${TICK}" "${str}"
                 else
                     printf "%b  %b %s\\n" "${OVER}" "${CROSS}" "${str}"