]> git.donarmstrong.com Git - unscd.git/commitdiff
use which instead of -x /path/to/cmd
authorDon Armstrong <don@donarmstrong.com>
Thu, 26 Oct 2017 23:38:40 +0000 (16:38 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 26 Oct 2017 23:38:40 +0000 (16:38 -0700)
debian/unscd.postinst

index 75d0cf4ed1d75154ca05b039e22b0c36a2c5dca7..27b83e263790c37b4e80748b970e4fff1ae7387b 100644 (file)
@@ -5,7 +5,10 @@ set -e
 case "$1" in
     configure)
         # Create the unscd user
-           if [ -x /usr/sbin/adduser ] && [ -x /usr/bin/getent ] && [ -x /usr/sbin/addgroup ]; then
+           if which adduser >/dev/null 2>&1 &&
+               which getent >/dev/null 2>&1 &&
+               which id >/dev/null 2>&1 &&
+               which addgroup >/dev/null 2>&1; then
                if ! getent group unscd >/dev/null 2>&1; then
                        addgroup --system unscd;
                fi;