1 #!/bin/sh /etc/rc.common
14 if ! echo "$CONFIG_OPTIONS" | grep " $varname " > /dev/null; then
15 CONFIG_OPTIONS="$CONFIG_OPTIONS $varname "
19 foreach_config_forced() {
20 foreach_config $1 "forced"
31 if [ -n "$2" ] && [ "x$2" == "xforced" ]; then
35 config_get name "$cfg" TYPE
36 for option in $CONFIG_OPTIONS
38 config_get value "$cfg" "$option"
39 if [ "x$option" == "xdisabled" ]; then
40 if [ $forced -eq 0 ] && [ $value -eq 1 ]; then
41 echo -n " $name(disabled)"
47 option=`echo $option | tr '_' '-'`
48 if [ -n "$value" ]; then
49 args="$args --$option $value"
54 $DAEMON --write-pid "$RUN_D/$BIN.$name.pid" $args || status="failed"
60 local pidfile=$RUN_D/$BIN.$name.pid
63 if [ ! -f "$pidfile" ]; then
64 status="tunnel not active"
66 kill `cat $pidfile` > /dev/null 2>&1 || status="failed"
73 echo -n "Starting $DESC:"
76 while [ $# -gt 0 ]; do
77 config_foreach foreach_config_forced "$1"
81 config_foreach foreach_config ""
87 echo -n "Stopping $DESC:"
92 while [ $# -gt 0 ]; do
97 for pidfile in `ls $RUN_D/$BIN.*.pid 2> /dev/null`; do
99 name=${name##$RUN_D/$BIN.}