summaryrefslogtreecommitdiffstats
path: root/base64.c
diff options
context:
space:
mode:
authorDavide Brini <dave_br@gmx.com>2010-04-19 22:41:42 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-10-21 11:37:03 +0200
commit5c9f1d2e703d0c8aaaf7254e9f3bd1bf0dddb120 (patch)
tree5a718070dc6cc2fa79491abc737044550044035d /base64.c
parent8517cba1997f5a08f1461ca90d159fcbe6392b5e (diff)
downloadopenvpn-5c9f1d2e703d0c8aaaf7254e9f3bd1bf0dddb120.tar.gz
openvpn-5c9f1d2e703d0c8aaaf7254e9f3bd1bf0dddb120.tar.xz
openvpn-5c9f1d2e703d0c8aaaf7254e9f3bd1bf0dddb120.zip
Enhance contrib/pull-resolv-conf/client.{up,down} scripts
Patch arrived from Davide Brini: - No more bashisms (AFAICT). Should work with any POSIX-compatible shell (which means "almost all reasonably recent shells"), though I've only tested with bash and dash. - Unnecessary calls to external tools (sed) removed - Manages multiple DNS and DOMAIN options. Each DNS option becomes a "nameserver" line in the new resolv.conf (up to a maximum of 3). If there's a single DOMAIN option, it becomes a "domain" line in resolv.conf; otherwise, all the domains are listed in a "search" line in resolv.conf (eg "search foo.com example.net"). - Client.up renames the existing resolv.conf and creates a brand new one; client.down restores it from the saved copy when the VPN terminates (the usual rules about running as root apply). This is how Gentoo does that; the old scripts instead added/removed some lines at the beginning of the file, which looks a less clean approach to me. The rename approach also dramatically simplifies and shortens client.down, as you'll see. - Uses resolvconf if it's available (detected by the presence of /sbin/resolvconf) rather than writing to resolv.conf directly. Not sure whether this is a Linux-only thing or other systems use it though. Script has been smoke tested on Fedora 12 with OpenVPN 2.1.1 without the resolvconf package , and in addition Debian Lenny with OpenVPN 2.1_rc11 according to the patch. Signed-off-by: Davide Brini <dave_br@gmx.com> Signed-off-by: David Sommerseth <dazo@users.sourceforge.net> Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'base64.c')
0 files changed, 0 insertions, 0 deletions