Use command -v rather than type master
authorRoy Marples <roy@marples.name>
Thu, 24 Feb 2022 15:44:32 +0000 (15:44 +0000)
committerRoy Marples <roy@marples.name>
Thu, 24 Feb 2022 15:44:32 +0000 (15:44 +0000)
command -v is now mandated by POSIX whereas type is an extension

dnsmasq.in
named.in
pdns_recursor.in
pdnsd.in
unbound.in

index 825dda950c43b3bd207c0fbb0edb9214ffcb1c2b..4a6e9d74aa8ed078a7573c83a7dbf900b8cdf62d 100644 (file)
@@ -151,7 +151,7 @@ else
 fi
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$dnsmasq_conf" "$dnsmasq_resolv"
 else
        @SBINDIR@/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv"
index 3301896416bb215f5a8356e44ae6ee4eefac425b..33c1db8e48ad8f2fbd0f0c63005d7d8fddb1ee8c 100644 (file)
--- a/named.in
+++ b/named.in
@@ -79,7 +79,7 @@ for d in $DOMAINS; do
 done
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$named_options" "$named_zones"
 else
        @SBINDIR@/resolvconf -D "$named_options" "$named_zones"
index 0cf96305f64099b43996d990c2f5239b7556e072..a4e5de0cb74c29d054101fefadd8258174313ed4 100644 (file)
@@ -54,7 +54,7 @@ for d in $DOMAINS; do
 done
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$pdnsd_zones"
 else
        @SBINDIR@/resolvconf -D "$pdnsd_zones"
index 2e8f6eb044b954ce06fd602396cc3c5e7e74b7e6..1afd785be20c5dac4709f6d62e7fecde1b651e50 100644 (file)
--- a/pdnsd.in
+++ b/pdnsd.in
@@ -46,7 +46,7 @@ remove_markers()
        in_marker=0
 
        shift; shift
-       if type sed >/dev/null 2>&1; then
+       if command -v sed >/dev/null 2>&1; then
                sed "/^$m1/,/^$m2/d" $@
        else
                for x do
@@ -66,9 +66,9 @@ remove_markers()
 change_file()
 {
        if [ -e "$1" ]; then
-               if type cmp >/dev/null 2>&1; then
+               if command -v cmp >/dev/null 2>&1; then
                        cmp -s "$1" "$2"
-               elif type diff >/dev/null 2>&1; then
+               elif command -v diff >/dev/null 2>&1; then
                        diff -q "$1" "$2" >/dev/null
                else
                        # Hopefully we're only working on small text files ...
@@ -88,7 +88,7 @@ newresolv="# Generated by resolvconf$NL"
 changed=false
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$pdnsd_resolv" "$pdnsd_conf"
 else
        @SBINDIR@/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf"
index bdb7766573cdb09e2f6a8df95a1f369c057e331b..23876d8c14a97c5dd4efc36114080af4f1a45477 100644 (file)
@@ -64,7 +64,7 @@ if [ -n "$NAMESERVERS" ]; then
 fi
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$unbound_conf"
 else
        @SBINDIR@/resolvconf -D "$unbound_conf"