From f9b85c98f1c96ceb4f98b004da1957305dfabeb6 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sat, 8 Jan 2011 10:07:00 +0000 Subject: 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) --- security/openvpn/Makefile | 1 + security/openvpn/files/openvpn.sh.in | 16 ++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'security/openvpn') diff --git a/security/openvpn/Makefile b/security/openvpn/Makefile index 4031cc8a239d..f9cc146baec1 100644 --- a/security/openvpn/Makefile +++ b/security/openvpn/Makefile @@ -85,6 +85,7 @@ post-build: cd ${WRKSRC}/plugin/auth-pam && ${CC} ${CPPFLAGS} -I../.. -DDLOPEN_PAM=0 ${CFLAGS} -fPIC -shared -Wl,-soname,openvpn-auth-pam.so -o openvpn-auth-pam.so auth-pam.c pamdl.c -lc -lpam @# self-tests here .if !defined(WITHOUT_CHECK) + @${ECHO} ; ${ECHO} "### Note that you can skip these lengthy selftests with WITHOUT_CHECK=yes ###" ; ${ECHO} cd ${WRKSRC} && ${MAKE} check .endif diff --git a/security/openvpn/files/openvpn.sh.in b/security/openvpn/files/openvpn.sh.in index 64f6da0afbe7..9a081ed48e4f 100644 --- a/security/openvpn/files/openvpn.sh.in +++ b/security/openvpn/files/openvpn.sh.in @@ -31,7 +31,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 @@ -67,23 +67,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 @@ -123,8 +121,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\"}" -- cgit v1.2.3