mirror of
https://github.com/OpenVPN/openvpn.git
synced 2025-05-08 21:25:53 +08:00
Remove hardcoded path to resolvconf
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>
This commit is contained in:
parent
22178d05f7
commit
3adf2f558e
@ -34,9 +34,10 @@
|
|||||||
# A horrid work around, from a security perspective,
|
# A horrid work around, from a security perspective,
|
||||||
# is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
|
# is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
|
||||||
# been WARNED.
|
# been WARNED.
|
||||||
|
PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
|
||||||
|
|
||||||
if [ -x /sbin/resolvconf ] ; then
|
if type resolvconf >/dev/null 2>&1; then
|
||||||
/sbin/resolvconf -d "${1}"
|
resolvconf -d "${1}" -f
|
||||||
elif [ -e /etc/resolv.conf.ovpnsave ] ; then
|
elif [ -e /etc/resolv.conf.ovpnsave ] ; then
|
||||||
# cp + rm rather than mv in case it's a symlink
|
# cp + rm rather than mv in case it's a symlink
|
||||||
cp /etc/resolv.conf.ovpnsave /etc/resolv.conf
|
cp /etc/resolv.conf.ovpnsave /etc/resolv.conf
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
# A horrid work around, from a security perspective,
|
# A horrid work around, from a security perspective,
|
||||||
# is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
|
# is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
|
||||||
# been WARNED.
|
# been WARNED.
|
||||||
|
PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
|
||||||
|
|
||||||
# init variables
|
# init variables
|
||||||
|
|
||||||
@ -86,8 +87,8 @@ fi
|
|||||||
out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${nl}${ds}${domains}"
|
out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${nl}${ds}${domains}"
|
||||||
|
|
||||||
# use resolvconf if it's available
|
# use resolvconf if it's available
|
||||||
if [ -x /sbin/resolvconf ] ; then
|
if type resolvconf >/dev/null 2>&1; then
|
||||||
printf "%s\n" "${out}" | /sbin/resolvconf -a "${1}"
|
printf "%s\n" "${out}" | resolvconf -p -a "${1}"
|
||||||
else
|
else
|
||||||
# Preserve the existing resolv.conf
|
# Preserve the existing resolv.conf
|
||||||
if [ -e /etc/resolv.conf ] ; then
|
if [ -e /etc/resolv.conf ] ; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user