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
This commit is contained in:
markus 2009-08-11 17:00:51 +00:00
parent 4dc66bd5f6
commit df86baf7e4

View File

@ -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
}