aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2007-03-06 13:00:02 +0000
committerRong-En Fan <rafan@FreeBSD.org>2007-03-06 13:00:02 +0000
commitf5172f575dad1a97323778ef14262c26fb541d7f (patch)
tree34eed0ab06f556cd73973ebf37935781d7d501b8 /security
parent04fbe4bdd47aa0e72051ae44975d99ae4350e542 (diff)
downloadports-f5172f575dad1a97323778ef14262c26fb541d7f.tar.gz
ports-f5172f575dad1a97323778ef14262c26fb541d7f.zip
- Update to 2.1 RC2
- Port rc script changes from security/openvpn 2.0.6_7 to support multiple instances PR: ports/109909 Submitted by: Matthias Andree <matthias.andree at gmx.de> (maintainer)
Notes
Notes: svn path=/head/; revision=186669
Diffstat (limited to 'security')
-rw-r--r--security/openvpn-devel/Makefile2
-rw-r--r--security/openvpn-devel/distinfo6
-rw-r--r--security/openvpn-devel/files/openvpn.sh.in71
-rw-r--r--security/openvpn-devel/files/pkg-message.in2
4 files changed, 55 insertions, 26 deletions
diff --git a/security/openvpn-devel/Makefile b/security/openvpn-devel/Makefile
index f784e4ba5577..eb821bc8b54b 100644
--- a/security/openvpn-devel/Makefile
+++ b/security/openvpn-devel/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= openvpn
-DISTVERSION= 2.1_rc1
+DISTVERSION= 2.1_rc2
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-devel/distinfo b/security/openvpn-devel/distinfo
index 9561e8564efc..c3b55c30bab1 100644
--- a/security/openvpn-devel/distinfo
+++ b/security/openvpn-devel/distinfo
@@ -1,3 +1,3 @@
-MD5 (openvpn-2.1_rc1.tar.gz) = b0773149ef9d93a0075dfa42b87042a0
-SHA256 (openvpn-2.1_rc1.tar.gz) = b5eb4f0d4eda58aaa8b60eb1b2f1d1a0d55ca22e9b098a2f65b6f44abc1c9e11
-SIZE (openvpn-2.1_rc1.tar.gz) = 796620
+MD5 (openvpn-2.1_rc2.tar.gz) = 853c81d2de51d85b5381d4c7f7f074e3
+SHA256 (openvpn-2.1_rc2.tar.gz) = 696630de3b8a8308a508d7ee1965fc5f2d6487ecb3d75e19c249c76f70ebfcb4
+SIZE (openvpn-2.1_rc2.tar.gz) = 802075
diff --git a/security/openvpn-devel/files/openvpn.sh.in b/security/openvpn-devel/files/openvpn.sh.in
index b4fc4dbba162..569dfb5d802f 100644
--- a/security/openvpn-devel/files/openvpn.sh.in
+++ b/security/openvpn-devel/files/openvpn.sh.in
@@ -2,10 +2,10 @@
#
# openvpn.sh - load tun/tap driver and start OpenVPN daemon
#
-# (C) Copyright 2005 by Matthias Andree
+# (C) Copyright 2005 - 2007 by Matthias Andree
# based on suggestions by Matthias Grimm and Dirk Gouders
-#
-# Made in Northrhine-Westphalia, Germany
+# with multi-instance contribution from Denis Shaposhnikov, Gleb Kozyrev
+# and Vasil Dimov
#
# $FreeBSD$
#
@@ -30,17 +30,29 @@
# -----------------------------------------------------------------------------
#
-# Add the following lines to /etc/rc.conf to enable openvpn at boot-up time:
+# This script supports running multiple instances of openvpn.
+# To run additional instance 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
+#
+# Below NAME should be substituted with the name of this script. By default
+# it is openvpn, so read as openvpn_enable. If you linked the script to
+# openvpn_foo, then read as openvpn_foo_enable etc.
#
-# openvpn_enable="YES" # YES or NO
-# openvpn_if="tun" # driver(s) to load, set to "tun", "tap" or "tun tap"
+# The following variables are supported (defaults are shown).
+# You can place them in any of
+# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/NAME
+#
+# NAME_enable="NO" # set to YES to enable openvpn
+# NAME_if="" # driver(s) to load, set to "tun", "tap" or "tun tap"
#
# # optional:
-# openvpn_flags="" # openvpn command line flags
-# openvpn_configfile="%%PREFIX%%/etc/openvpn/openvpn.conf" # --config file
-# openvpn_dir="%%PREFIX%%/etc/openvpn" # --cd directory
+# NAME_flags="" # additional command line arguments
+# NAME_configfile="%%PREFIX%%/etc/openvpn/NAME.conf" # --config file
+# NAME_dir="%%PREFIX%%/etc/openvpn" # --cd directory
#
-# You also need to set openvpn_configfile and openvpn_dir, if the configuration
+# You also need to set NAME_configfile and NAME_dir, if the configuration
# file and directory where keys and certificates reside differ from the above
# settings.
#
@@ -51,14 +63,24 @@
. %%RC_SUBR%%
-name=openvpn
-rcvar=`set_rcvar`
+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=$(basename "$0" .sh)
+ ;;
+esac
+
+rcvar=$(set_rcvar)
prefix="%%PREFIX%%"
openvpn_precmd()
{
- for i in $openvpn_if ; do
+ 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
@@ -85,7 +107,7 @@ extra_commands="reload"
pidfile="/var/run/${name}.pid"
# command and arguments
-command="%%PREFIX%%/sbin/${name}"
+command="%%PREFIX%%/sbin/openvpn"
# run this first
start_precmd="openvpn_precmd"
@@ -93,11 +115,18 @@ start_precmd="openvpn_precmd"
stop_postcmd="stop_postcmd"
load_rc_config ${name}
-: ${openvpn_enable="NO"}
-: ${openvpn_flags=""}
-: ${openvpn_if=""}
-: ${openvpn_configfile="${prefix}/etc/openvpn/openvpn.conf"}
-: ${openvpn_dir="${prefix}/etc/openvpn"}
-required_files="${openvpn_configfile}"
-command_args="--cd ${openvpn_dir} --daemon --config ${openvpn_configfile} --writepid ${pidfile}"
+
+eval ": \${${name}_enable:=\"NO\"}"
+eval ": \${${name}_flags:=\"\"}"
+eval ": \${${name}_if:=\"\"}"
+eval ": \${${name}_configfile:=\"${prefix}/etc/openvpn/${name}.conf\"}"
+eval ": \${${name}_dir:=\"${prefix}/etc/openvpn\"}"
+
+configfile="$(eval echo \${${name}_configfile})"
+dir="$(eval echo \${${name}_dir})"
+interfaces="$(eval echo \${${name}_if})"
+
+required_files=${configfile}
+command_args="--cd ${dir} --daemon --config ${configfile} --writepid ${pidfile}"
+
run_rc_command "$1"
diff --git a/security/openvpn-devel/files/pkg-message.in b/security/openvpn-devel/files/pkg-message.in
index 8b4d71ee5926..5abc9aad90e0 100644
--- a/security/openvpn-devel/files/pkg-message.in
+++ b/security/openvpn-devel/files/pkg-message.in
@@ -8,5 +8,5 @@
### If you want to donate to OpenVPN: <http://openvpn.net/donate.html>
### ------------------------------------------------------------------------
### NOTE THIS IS AN UNSTABLE VERSION UNDER DEVELOPMENT!
-### Consider using the stable version instead for production.
+### It may or may not be suitable for production. Use at your own risk.
### ------------------------------------------------------------------------