aboutsummaryrefslogtreecommitdiffstats
path: root/security/openvpn-devel
diff options
context:
space:
mode:
authorrafan <rafan@FreeBSD.org>2007-03-06 21:00:02 +0800
committerrafan <rafan@FreeBSD.org>2007-03-06 21:00:02 +0800
commit25dbfae27dc9659215e344d4861f2e807efe15fd (patch)
tree8aa6f601ea9917f41e6568ec9d137fbc16b67445 /security/openvpn-devel
parentde66427d9d17c9cabd276f9735a9bfb84cf0489c (diff)
downloadfreebsd-ports-graphics-25dbfae27dc9659215e344d4861f2e807efe15fd.tar.gz
freebsd-ports-graphics-25dbfae27dc9659215e344d4861f2e807efe15fd.tar.zst
freebsd-ports-graphics-25dbfae27dc9659215e344d4861f2e807efe15fd.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)
Diffstat (limited to 'security/openvpn-devel')
-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 f784e4ba557..eb821bc8b54 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 9561e8564ef..c3b55c30bab 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 b4fc4dbba16..569dfb5d802 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 8b4d71ee592..5abc9aad90e 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.
### ------------------------------------------------------------------------