]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Use provided env vars in up/down script.
authorConrad Hoffmann <ch@bitfehler.net>
Wed, 2 Aug 2017 18:14:34 +0000 (20:14 +0200)
committerDavid Sommerseth <davids@openvpn.net>
Mon, 14 Aug 2017 13:37:58 +0000 (15:37 +0200)
This makes the down script work both as regular down script as well as
with the
down-root plugin. The up script is just changed for consistency.

Signed-off-by: Conrad Hoffmann <ch@bitfehler.net>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20170802181435.14549-2-ch@bitfehler.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15165.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
(cherry picked from commit 94c1ce22ebcc1f672bb80598afccc130aa01fafc)

contrib/pull-resolv-conf/client.down
contrib/pull-resolv-conf/client.up

index 05f2d4d54652bfbd19228831d053ed761c4c0309..90bc5891ab28bee25869beb7456c90a62cb94551 100644 (file)
@@ -37,7 +37,7 @@
 PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
 
 if type resolvconf >/dev/null 2>&1; then
-  resolvconf -d "${1}" -f
+  resolvconf -d "${dev}" -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 8858b4766d9e4af5f88ffb36b3c5ac3c213d8d03..260c038e9b111e15b1dc1a7fbe0db3690775f420 100644 (file)
@@ -87,11 +87,11 @@ elif [ $ndoms -gt 1 ]; then
 fi
 
 # This is the complete file - "$domains" has a leading space already
-out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${ds}${domains}"
+out="# resolv.conf autogenerated by ${0} (${dev})${nl}${dns}${ds}${domains}"
 
 # use resolvconf if it's available
 if type resolvconf >/dev/null 2>&1; then
-  printf "%s\n" "${out}" | resolvconf -p -a "${1}"
+  printf "%s\n" "${out}" | resolvconf -p -a "${dev}"
 else
   # Preserve the existing resolv.conf
   if [ -e /etc/resolv.conf ] ; then