]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Allow resolvconf to be user tunable.
authorRoy Marples <roy@marples.name>
Thu, 28 Jul 2016 10:02:42 +0000 (10:02 +0000)
committerRoy Marples <roy@marples.name>
Thu, 28 Jul 2016 10:02:42 +0000 (10:02 +0000)
dhcpcd-hooks/20-resolv.conf

index de9013bc2c6db99a5b5bdc3cc1820699b52f0a07..e4db368dd8efbb2da99492841e6a03c38c70d006 100644 (file)
@@ -9,6 +9,7 @@
 resolv_conf_dir="$state_dir/resolv.conf"
 NL="
 "
+: ${resolvconf:=resolvconf}
 
 build_resolv_conf()
 {
@@ -162,9 +163,9 @@ add_resolv_conf()
        for x in ${new_domain_name_servers}; do
                conf="${conf}nameserver $x$NL"
        done
-       if type resolvconf >/dev/null 2>&1; then
+       if type "$resolvconf" >/dev/null 2>&1; then
                [ -n "$ifmetric" ] && export IF_METRIC="$ifmetric"
-               printf %s "$conf" | resolvconf -a "$ifname"
+               printf %s "$conf" | "$resolvconf" -a "$ifname"
                return $?
        fi
 
@@ -178,8 +179,8 @@ add_resolv_conf()
 
 remove_resolv_conf()
 {
-       if type resolvconf >/dev/null 2>&1; then
-               resolvconf -d "$ifname" -f
+       if type "$resolvconf" >/dev/null 2>&1; then
+               "$resolvconf" -d "$ifname" -f
        else
                if [ -e "$resolv_conf_dir/$ifname" ]; then
                        rm -f "$resolv_conf_dir/$ifname"