aboutsummaryrefslogtreecommitdiffstats
path: root/security/openvpn20
diff options
context:
space:
mode:
authormandree <mandree@FreeBSD.org>2011-01-08 18:07:00 +0800
committermandree <mandree@FreeBSD.org>2011-01-08 18:07:00 +0800
commitc3a0d1b78d76016a679bccde94d6b6eb87cda0a6 (patch)
treee7254a34173ea79676aca04213a44ec92ba5d2eb /security/openvpn20
parent8b79581f9e41c7fa40cef09e654191a417573529 (diff)
downloadfreebsd-ports-gnome-c3a0d1b78d76016a679bccde94d6b6eb87cda0a6.tar.gz
freebsd-ports-gnome-c3a0d1b78d76016a679bccde94d6b6eb87cda0a6.tar.zst
freebsd-ports-gnome-c3a0d1b78d76016a679bccde94d6b6eb87cda0a6.zip
Streamline a bit:
- remove subshell to use basename, and use ## substitution [1] - remove FreeBSD 5.X compatibility comment [1] - remove FreeBSD 5.X compatibility code The parts marked with [1] above were Submitted by: dougb (Doug Barton)
Diffstat (limited to 'security/openvpn20')
-rw-r--r--security/openvpn20/files/openvpn.sh.in16
1 files changed, 6 insertions, 10 deletions
diff --git a/security/openvpn20/files/openvpn.sh.in b/security/openvpn20/files/openvpn.sh.in
index 050984cdef9c..894b40538616 100644
--- a/security/openvpn20/files/openvpn.sh.in
+++ b/security/openvpn20/files/openvpn.sh.in
@@ -30,7 +30,7 @@
# -----------------------------------------------------------------------------
#
# This script supports running multiple instances of openvpn.
-# To run additional instance link this script to something like
+# To run additional instances link this script to something like
# % ln -s openvpn openvpn_foo
# and define additional openvpn_foo_* variables in one of
# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/openvpn_foo
@@ -66,23 +66,21 @@ case "$0" in
/etc/rc*)
# during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown),
# so get the name of the script from $_file
- name=$(basename "$_file" .sh)
+ name="$_file"
;;
*)
- name=$(basename "$0" .sh)
+ name="$0"
;;
esac
+name="${name##*/}"
+
rcvar=$(set_rcvar)
openvpn_precmd()
{
for i in $interfaces ; do
- # FreeBSD <= 5.4 does not know kldstat's -m option
- # FreeBSD >= 6.0 does not add debug.* sysctl information
- # in the default build - we check both to keep things simple
- if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 \
- && ! kldstat -m if_${i} >/dev/null 2>&1 ; then
+ if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 ; then
if ! kldload if_${i} ; then
warn "Could not load $i module."
return 1
@@ -114,8 +112,6 @@ stop_postcmd="stop_postcmd"
load_rc_config ${name}
eval ": \${${name}_enable:=\"NO\"}"
-eval ": \${${name}_flags:=\"\"}"
-eval ": \${${name}_if:=\"\"}"
eval ": \${${name}_configfile:=\"%%PREFIX%%/etc/openvpn/${name}.conf\"}"
eval ": \${${name}_dir:=\"%%PREFIX%%/etc/openvpn\"}"