summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2006-11-01 21:45:20 +0000
committerRoy Marples <uberlord@gentoo.org>2006-11-01 21:45:20 +0000
commitc0ac70120112a8cc3ef3fecac5e51897823488eb (patch)
tree01d50b3b106992994df88fa9cc98c320faed04c3
parentRe-add snmp USE flag (bug #152701). Thanks to Francisco Javier <ffelix@sshinf... (diff)
downloadgentoo-2-c0ac70120112a8cc3ef3fecac5e51897823488eb.tar.gz
gentoo-2-c0ac70120112a8cc3ef3fecac5e51897823488eb.tar.bz2
gentoo-2-c0ac70120112a8cc3ef3fecac5e51897823488eb.zip
Ensure we work with all bash versions.
(Portage version: 2.1.2_rc1-r2)
-rw-r--r--net-misc/openvpn/ChangeLog6
-rwxr-xr-xnet-misc/openvpn/files/openvpn-2.1.init6
-rwxr-xr-xnet-misc/openvpn/files/up.sh8
3 files changed, 11 insertions, 9 deletions
diff --git a/net-misc/openvpn/ChangeLog b/net-misc/openvpn/ChangeLog
index abd06f06df79..38e1870ea661 100644
--- a/net-misc/openvpn/ChangeLog
+++ b/net-misc/openvpn/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-misc/openvpn
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.98 2006/10/17 14:55:03 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.99 2006/11/01 21:45:20 uberlord Exp $
+
+ 01 Nov 2006; Roy Marples <uberlord@gentoo.org> files/openvpn-2.1.init,
+ files/up.sh:
+ Ensure we work with all bash versions.
17 Oct 2006; Roy Marples <uberlord@gentoo.org> openvpn-2.0.7.ebuild,
openvpn-2.1_beta15.ebuild:
diff --git a/net-misc/openvpn/files/openvpn-2.1.init b/net-misc/openvpn/files/openvpn-2.1.init
index 81d181a65a47..060bc4d4a12b 100755
--- a/net-misc/openvpn/files/openvpn-2.1.init
+++ b/net-misc/openvpn/files/openvpn-2.1.init
@@ -37,16 +37,14 @@ checkconfig() {
# Other OS's don't, so we rely on a pre-configured interface
# per vpn instance
- local ifname=
- if [[ ! $'\n'$(<"${VPNCONF}") =~ \
- $'\n'"[[:space:]]*dev[[:space:]]*([^[[:space:]]*)" ]] ; then
+ local ifname=$(sed -n -e 's/[[:space:]]*dev[[:space:]][[:space:]]*\([^[:space:]]*\).*/\1/p' "${VPNCONF}")
+ if [[ -z ${ifname} ]] ; then
eerror "You need to specify the interface that this openvpn" \
"instance should use" \
"by using the dev option in ${VPNCONF}"
return 1
fi
- ifname="${BASH_REMATCH[1]}"
if ! ifconfig "${ifname}" &>/dev/null ; then
# Try and create it
echo > /dev/"${ifname}" &>/dev/null
diff --git a/net-misc/openvpn/files/up.sh b/net-misc/openvpn/files/up.sh
index 0a18876aae93..797d81af9f03 100755
--- a/net-misc/openvpn/files/up.sh
+++ b/net-misc/openvpn/files/up.sh
@@ -15,10 +15,10 @@ NS=
DOMAIN=
for var in ${!foreign_option_*} ; do
opt="${!var}"
- if [[ ${opt} =~ "dhcp-option DOMAIN (.*)" ]] ; then
- DOMAIN="${DNS}domain ${BASH_REMATCH[1]}\n"
- elif [[ ${opt} =~ "dhcp-option DNS (.*)" ]] ; then
- NS="${DNS}nameserver ${BASH_REMATCH[1]}\n"
+ if [[ ${opt} != "${opt#dhcp-option DOMAIN *}" ]] ; then
+ DOMAIN="${DNS}domain ${opt#dhcp-option DOMAIN *}\n"
+ elif [[ ${opt} != "${opt#dhcp-option DNS *}" ]] ; then
+ NS="${DNS}nameserver ${opt#dhcp-option DNS *}\n"
fi
done