aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-19 19:57:24 +0000
committerRoy Marples <roy@marples.name>2008-03-19 19:57:24 +0000
commit6159a32f39afc60d88602cc796cef6a395bb78bf (patch)
tree6b2471081a475c0c42b41bd7aca6a1a0e8fcdbe6 /support
parent6d2e1f7addcf5ff6594d381845708229086d8d96 (diff)
SVCNAME -> RC_SVCNAME, but export SVCNAME still for compat.
Diffstat (limited to 'support')
-rwxr-xr-xsupport/openvpn/down.sh10
-rwxr-xr-xsupport/openvpn/up.sh14
2 files changed, 8 insertions, 16 deletions
diff --git a/support/openvpn/down.sh b/support/openvpn/down.sh
index 686838a8..b58abb98 100755
--- a/support/openvpn/down.sh
+++ b/support/openvpn/down.sh
@@ -3,7 +3,7 @@
# All rights reserved. Released under the 2-clause BSD license.
# If we have a service specific script, run this now
-[ -x "${SVCNAME}"-down.sh ] && "${SVCNAME}"-down.sh
+[ -x "${RC_SVCNAME}"-down.sh ] && "${RC_SVCNAME}"-down.sh
# Restore resolv.conf to how it was
if type resolvconf >/dev/null 2>&1; then
@@ -16,12 +16,10 @@ elif [ -e /etc/resolv.conf-"${dev}".sv ]; then
fi
# Re-enter the init script to stop any dependant services
-service=/etc/init.d/"${SVCNAME}"
-[ ! -x "${service}" ] && service=/usr/local/etc/init.d/"${SVCNAME}"
-if [ -x "${service}" ]; then
- if "${service}" --quiet status; then
+if [ -x "${RC_SERVICE}" ]; then
+ if "${RC_SERVICE}" --quiet status; then
export IN_BACKGROUND=YES
- "${service}" --quiet stop
+ "${RC_SERVICE}" --quiet stop
fi
fi
diff --git a/support/openvpn/up.sh b/support/openvpn/up.sh
index 6d0c43e7..e466c263 100755
--- a/support/openvpn/up.sh
+++ b/support/openvpn/up.sh
@@ -18,8 +18,6 @@
# A possible workaround would be to just list multiple domain lines
# and try and let resolvconf handle it
-PATH=$PATH:/usr/local/sbin
-
NS=
DOMAIN=
SEARCH=
@@ -59,19 +57,15 @@ if [ -n "${NS}" ]; then
fi
# Below section is OpenRC specific
-# Quick summary - our init scripts are re-entrant and set the SVCNAME env var
-# as we could have >1 openvpn service
# If we have a service specific script, run this now
-[ -x "${SVCNAME}"-up.sh ] && "${SVCNAME}"-up.sh
+[ -x "${RC_SVCNAME}"-up.sh ] && "${RC_SVCNAME}"-up.sh
# Re-enter the init script to start any dependant services
-service=/etc/init.d/"${SVCNAME}"
-[ ! -x "${service}" ] && service=/usr/local/etc/init.d/"${SVCNAME}"
-if [ -x "${service}" ]; then
- if ! "${service}" --quiet status; then
+if [ -x "${RC_SERVICE}" ]; then
+ if ! "${RC_SERVICE}" --quiet status; then
export IN_BACKGROUND=true
- "${service}" --quiet start
+ "${RC_SERVICE}" --quiet start
fi
fi