# 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
# 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
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