diff options
author | mandree <mandree@FreeBSD.org> | 2011-08-31 01:11:57 +0800 |
---|---|---|
committer | mandree <mandree@FreeBSD.org> | 2011-08-31 01:11:57 +0800 |
commit | 346484172036f650e5890bdf956d2474909bd07f (patch) | |
tree | 26a192bf490ee637e1379bc9c48f9fbf930db2d9 /security | |
parent | ba72f333533d123eed3c448dfd4804b35bb64842 (diff) | |
download | freebsd-ports-gnome-346484172036f650e5890bdf956d2474909bd07f.tar.gz freebsd-ports-gnome-346484172036f650e5890bdf956d2474909bd07f.tar.zst freebsd-ports-gnome-346484172036f650e5890bdf956d2474909bd07f.zip |
Use required_modules rather than _precmd.
To fix failures with 'restart'.
Reported by: Miroslav Lachman
Diffstat (limited to 'security')
-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" |