]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove hardcoded path to resolvconf
authorJesse Young <jesse.young@gmail.com>
Mon, 1 Nov 2010 16:33:26 +0000 (11:33 -0500)
committerDavid Sommerseth <dazo@users.sourceforge.net>
Sun, 14 Nov 2010 22:03:20 +0000 (23:03 +0100)
Signed-off-by: Jesse Young <jesse.young@gmail.com>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
contrib/pull-resolv-conf/client.down
contrib/pull-resolv-conf/client.up

index 38c585b474870b8234c66c6c1c902fbbbd71ee26..05f2d4d54652bfbd19228831d053ed761c4c0309 100644 (file)
 # A horrid work around, from a security perspective,
 # is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
 # been WARNED.
+PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
 
-if [ -x /sbin/resolvconf ] ; then
-  /sbin/resolvconf -d "${1}"
+if type resolvconf >/dev/null 2>&1; then
+  resolvconf -d "${1}" -f
 elif [ -e /etc/resolv.conf.ovpnsave ] ; then
   # cp + rm rather than mv in case it's a symlink
   cp /etc/resolv.conf.ovpnsave /etc/resolv.conf
index e81bd3a8b419dd973f60f60178d1f7375036e3a2..b28d4d191713013cb41afe4e1d7223ee47d4a755 100644 (file)
@@ -33,6 +33,7 @@
 # A horrid work around, from a security perspective,
 # is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
 # been WARNED.
+PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
 
 # init variables
 
@@ -86,8 +87,8 @@ fi
 out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${nl}${ds}${domains}"
 
 # use resolvconf if it's available
-if [ -x /sbin/resolvconf ] ; then
-  printf "%s\n" "${out}" | /sbin/resolvconf -a "${1}"
+if type resolvconf >/dev/null 2>&1; then
+  printf "%s\n" "${out}" | resolvconf -p -a "${1}"
 else
   # Preserve the existing resolv.conf
   if [ -e /etc/resolv.conf ] ; then