diff options
author | Matthias Andree <mandree@FreeBSD.org> | 2011-08-30 17:11:57 +0000 |
---|---|---|
committer | Matthias Andree <mandree@FreeBSD.org> | 2011-08-30 17:11:57 +0000 |
commit | a2cf6822c55e6a28a2b7e1dc9e5ae336f1cd55cb (patch) | |
tree | 466b0366a481f160505bd31a2d3d4c3a9c669656 | |
parent | update to 0.2.2.32 (diff) |
Use required_modules rather than _precmd.
To fix failures with 'restart'.
Reported by: Miroslav Lachman
-rw-r--r-- | security/openvpn/Makefile | 1 | ||||
-rw-r--r-- | security/openvpn/files/openvpn.sh.in | 24 |
2 files changed, 9 insertions, 16 deletions
diff --git a/security/openvpn/Makefile b/security/openvpn/Makefile index e4a84fdfa186..c1fe6010d95f 100644 --- a/security/openvpn/Makefile +++ b/security/openvpn/Makefile @@ -7,6 +7,7 @@ PORTNAME= openvpn DISTVERSION= 2.2.1 +PORTREVISION= 1 CATEGORIES= security net # MASTER_SITES points to hosts in distinct data centers, # so just one MASTER_SITES entry should be OK. diff --git a/security/openvpn/files/openvpn.sh.in b/security/openvpn/files/openvpn.sh.in index 6e88286ad51c..d2539131a212 100644 --- a/security/openvpn/files/openvpn.sh.in +++ b/security/openvpn/files/openvpn.sh.in @@ -46,6 +46,7 @@ # # NAME_enable="NO" # set to YES to enable openvpn # NAME_if= # driver(s) to load, set to "tun", "tap" or "tun tap" +# # it is OK to specify the if_ prefix. # # # optional: # NAME_flags= # additional command line arguments @@ -78,19 +79,6 @@ name="${name##*/}" rcvar=$(set_rcvar) -openvpn_precmd() -{ - for i in $interfaces ; do - if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 ; then - if ! kldload if_${i} ; then - warn "Could not load $i module." - return 1 - fi - fi - done - return 0 -} - stop_postcmd() { rm -f "$pidfile" || warn "Could not remove $pidfile." @@ -113,9 +101,7 @@ pidfile="/var/run/${name}.pid" # command and arguments command="%%PREFIX%%/sbin/openvpn" -# run this first -start_precmd="openvpn_precmd" -# and this last +# run this last stop_postcmd="stop_postcmd" load_rc_config ${name} @@ -128,7 +114,13 @@ configfile="$(eval echo \${${name}_configfile})" dir="$(eval echo \${${name}_dir})" interfaces="$(eval echo \${${name}_if})" +required_modules= +for i in $interfaces ; do + required_modules="$required_modules${required_modules:+" "}if_${i#if_}" +done + required_files=${configfile} + command_args="--cd ${dir} --daemon ${name} --config ${configfile} --writepid ${pidfile}" run_rc_command "$1" |