summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2006-05-11 13:57:06 +0000
committerRoy Marples <uberlord@gentoo.org>2006-05-11 13:57:06 +0000
commite7a9a4c2fabdaf21ac0b22bc8acbc390181cc721 (patch)
tree4b870a655cab172b52a76cfa0ff3b296ae9eff8e /net-misc/openvpn
parentBump to 0.8. (diff)
downloadgentoo-2-e7a9a4c2fabdaf21ac0b22bc8acbc390181cc721.tar.gz
gentoo-2-e7a9a4c2fabdaf21ac0b22bc8acbc390181cc721.tar.bz2
gentoo-2-e7a9a4c2fabdaf21ac0b22bc8acbc390181cc721.zip
Tweak the scripts to force bash and make dns handling in up.sh a little more robust
(Portage version: 2.1_pre10-r5)
Diffstat (limited to 'net-misc/openvpn')
-rwxr-xr-xnet-misc/openvpn/files/down.sh2
-rwxr-xr-xnet-misc/openvpn/files/up.sh17
2 files changed, 9 insertions, 10 deletions
diff --git a/net-misc/openvpn/files/down.sh b/net-misc/openvpn/files/down.sh
index 28ecd304ff20..98a9104e8db6 100755
--- a/net-misc/openvpn/files/down.sh
+++ b/net-misc/openvpn/files/down.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Roy Marples (uberlord@gentoo.org)
diff --git a/net-misc/openvpn/files/up.sh b/net-misc/openvpn/files/up.sh
index b67d3266556e..7e6c0719d4aa 100755
--- a/net-misc/openvpn/files/up.sh
+++ b/net-misc/openvpn/files/up.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Roy Marples (uberlord@gentoo.org)
@@ -11,18 +11,17 @@
# and will use the first one that responds - maybe the LAN ones?
# non resolvconf users just the the VPN resolv.conf
-DNS="$( set | sed -n "s/^foreign_option_.* DNS \(.*\)'/nameserver \1/; T next; p;
+DNS="$(set | sed -n "s/^foreign_option_.* DNS \(.*\)'/nameserver \1/; T next; p;
:next; s/^foreign_option_.* DOMAIN \(.*\)'/domain \1/; T; p;")"
if [[ -n ${DNS} ]] ; then
DNS="# Generated by openvpn for interface ${dev}\n${DNS}"
-fi
-
-if [[ -x /sbin/resolvconf ]] ; then
- echo -e "${DNS}" | /sbin/resolvconf -a "${dev}"
-elif [[ -n ${DNS} ]] ; then
- echo -e "${DNS}" > /etc/resolv.conf
- chmod 644 /etc/resolv.conf
+ if [[ -x /sbin/resolvconf ]] ; then
+ echo -e "${DNS}" | /sbin/resolvconf -a "${dev}"
+ else
+ echo -e "${DNS}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
# If we have a service specific script, run this now