summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2007-02-07 10:36:09 +0000
committerRoy Marples <uberlord@gentoo.org>2007-02-07 10:36:09 +0000
commit59e8c7d8a5550ae7a659d6e332b78a71e2373068 (patch)
tree9e1d1dc4ffada3332ea2fcbbeecb1b2243ae185b /net-misc/openvpn
parentVersion bump. Add DOCS. Add RDEPEND. Add IUSE="debug". Edit description. Clea... (diff)
downloadgentoo-2-59e8c7d8a5550ae7a659d6e332b78a71e2373068.tar.gz
gentoo-2-59e8c7d8a5550ae7a659d6e332b78a71e2373068.tar.bz2
gentoo-2-59e8c7d8a5550ae7a659d6e332b78a71e2373068.zip
up.sh and down.sh no longer require bash.
(Portage version: 2.1.2-r8)
Diffstat (limited to 'net-misc/openvpn')
-rw-r--r--net-misc/openvpn/ChangeLog5
-rwxr-xr-xnet-misc/openvpn/files/down.sh10
-rwxr-xr-xnet-misc/openvpn/files/up.sh23
3 files changed, 22 insertions, 16 deletions
diff --git a/net-misc/openvpn/ChangeLog b/net-misc/openvpn/ChangeLog
index fd025159351c..13306edb43e5 100644
--- a/net-misc/openvpn/ChangeLog
+++ b/net-misc/openvpn/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for net-misc/openvpn
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.103 2007/01/05 09:03:15 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.104 2007/02/07 10:36:09 uberlord Exp $
+
+ 07 Feb 2007; Roy Marples <uberlord@gentoo.org> files/down.sh, files/up.sh:
+ up.sh and down.sh no longer require bash.
05 Jan 2007; Diego Pettenò <flameeyes@gentoo.org> openvpn-2.0.6.ebuild,
openvpn-2.0.7.ebuild, openvpn-2.0.7-r1.ebuild, openvpn-2.1_rc1.ebuild,
diff --git a/net-misc/openvpn/files/down.sh b/net-misc/openvpn/files/down.sh
index 321ca7bbfaa5..85f565b0ea45 100755
--- a/net-misc/openvpn/files/down.sh
+++ b/net-misc/openvpn/files/down.sh
@@ -1,17 +1,17 @@
-#!/bin/bash
+#!/bin/sh
# Copyright (c) 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Roy Marples (uberlord@gentoo.org)
# If we have a service specific script, run this now
-if [[ -x /etc/openvpn/"${SVCNAME}"-down.sh ]] ; then
- ( /etc/openvpn/"${SVCNAME}"-down.sh )
+if [ -x /etc/openvpn/"${SVCNAME}"-down.sh ] ; then
+ /etc/openvpn/"${SVCNAME}"-down.sh
fi
# Restore resolv.conf to how it was
-if [[ -x /sbin/resolvconf ]] ; then
+if [ -x /sbin/resolvconf ] ; then
/sbin/resolvconf -d "${dev}"
-elif [[ -e /etc/resolv.conf-"${dev}".sv ]] ; then
+elif [ -e /etc/resolv.conf-"${dev}".sv ] ; then
# Important that we copy instead of move incase resolv.conf is
# a symlink and not an actual file
cp /etc/resolv.conf-"${dev}".sv /etc/resolv.conf
diff --git a/net-misc/openvpn/files/up.sh b/net-misc/openvpn/files/up.sh
index 797d81af9f03..7ec451796184 100755
--- a/net-misc/openvpn/files/up.sh
+++ b/net-misc/openvpn/files/up.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Copyright (c) 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Roy Marples (uberlord@gentoo.org)
@@ -13,22 +13,25 @@
NS=
DOMAIN=
-for var in ${!foreign_option_*} ; do
- opt="${!var}"
- if [[ ${opt} != "${opt#dhcp-option DOMAIN *}" ]] ; then
+i=1
+while true ; do
+ eval opt=\$foreign_option_${i}
+ [ -z "${opt}" ] && break
+ if [ "${opt}" != "${opt#dhcp-option DOMAIN *}" ] ; then
DOMAIN="${DNS}domain ${opt#dhcp-option DOMAIN *}\n"
- elif [[ ${opt} != "${opt#dhcp-option DNS *}" ]] ; then
+ elif [ "${opt}" != "${opt#dhcp-option DNS *}" ] ; then
NS="${DNS}nameserver ${opt#dhcp-option DNS *}\n"
fi
+ i=$((i + 1))
done
-if [[ -n ${NS} ]] ; then
+if [ -n "${NS}" ] ; then
DNS="# Generated by openvpn for interface ${dev}\n${DOMAIN}${NS}"
- if [[ -x /sbin/resolvconf ]] ; then
+ if [ -x /sbin/resolvconf ] ; then
echo -e "${DNS}" | /sbin/resolvconf -a "${dev}"
else
# Preserve the existing resolv.conf
- if [[ -e /etc/resolv.conf ]] ; then
+ if [ -e /etc/resolv.conf ] ; then
cp /etc/resolv.conf /etc/resolv.conf-"${dev}".sv
fi
echo -e "${DNS}" > /etc/resolv.conf
@@ -37,8 +40,8 @@ if [[ -n ${NS} ]] ; then
fi
# If we have a service specific script, run this now
-if [[ -x /etc/openvpn/"${SVCNAME}"-up.sh ]] ; then
- ( /etc/openvpn/"${SVCNAME}"-up.sh )
+if [ -x /etc/openvpn/"${SVCNAME}"-up.sh ] ; then
+ /etc/openvpn/"${SVCNAME}"-up.sh
fi
# Re-enter the init script to start any dependant services