From df86baf7e40721c608dce26bdc1b748a66513081 Mon Sep 17 00:00:00 2001 From: markus Date: Tue, 11 Aug 2009 17:00:51 +0000 Subject: [PATCH] added extra commands "up" and "down" to selectively start or stop single or multiple instances of openvpn. This could be used from luci to manage running instances. git-svn-id: svn://svn.openwrt.org/openwrt/packages@17226 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/openvpn/files/openvpn.init | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/net/openvpn/files/openvpn.init b/net/openvpn/files/openvpn.init index d19741021..7b447e06b 100644 --- a/net/openvpn/files/openvpn.init +++ b/net/openvpn/files/openvpn.init @@ -7,6 +7,7 @@ START=95 BIN=/usr/sbin/openvpn SSD=start-stop-daemon +EXTRA_COMMANDS="up down" LIST_SEP=" " @@ -142,3 +143,27 @@ reload() { restart() { stop; sleep 5; start } + +up() { + local exists + local INSTANCE + for INSTANCE in "$@"; do + config_load openvpn + config_get exists "$INSTANCE" TYPE + if [ "$exists" == "openvpn" ]; then + start_service "$INSTANCE" + fi + done +} + +down() { + local exists + local INSTANCE + for INSTANCE in "$@"; do + config_load openvpn + config_get exists "$INSTANCE" TYPE + if [ "$exists" == "openvpn" ]; then + stop_service "$INSTANCE" + fi + done +} -- 2.11.0