summaryrefslogtreecommitdiff
path: root/openwrt/kamikaze/uanytun-sslcrypt/files/uanytun.init
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-05 19:02:37 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-05 19:02:37 +0000
commita4cab19e1cade3ef7dc867b481a7c00055bdd35d (patch)
treedd3cea48a1aac9105c1af8652af1ee85a84e4ff3 /openwrt/kamikaze/uanytun-sslcrypt/files/uanytun.init
parentadded openwrt initscript and config (diff)
moved uanytun-sslcrypt kamikaze package to default (uanytun)
Diffstat (limited to 'openwrt/kamikaze/uanytun-sslcrypt/files/uanytun.init')
-rwxr-xr-xopenwrt/kamikaze/uanytun-sslcrypt/files/uanytun.init74
1 files changed, 0 insertions, 74 deletions
diff --git a/openwrt/kamikaze/uanytun-sslcrypt/files/uanytun.init b/openwrt/kamikaze/uanytun-sslcrypt/files/uanytun.init
deleted file mode 100755
index 27296ca..0000000
--- a/openwrt/kamikaze/uanytun-sslcrypt/files/uanytun.init
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh /etc/rc.common
-START=50
-
-BIN=uanytun
-DESC=uanytun
-RUN_D=/var/run
-
-uanytun() {
- local name
- name=${2%%.pid}
- name=${name##/var/run/uanytun.}
- echo "$name" > $2
-}
-
-option_cb() {
- local varname="$1"
- local value="$2"
-
- if ! echo "$CONFIG_OPTIONS" | grep " $varname " > /dev/null; then
- CONFIG_OPTIONS="$CONFIG_OPTIONS $varname "
- fi
-}
-
-foreach_config() {
- local cfg="$1"
- local name
- local option
- local value
- local DAEMONARGS=""
-
- config_get name "$cfg" TYPE
- for option in $CONFIG_OPTIONS
- do
- config_get value "$cfg" "$option"
- if [ "x$option" == "xdisabled" ]; then
- if [ $value -eq 1 ]; then
- echo -n " $name(disabled)"
- return
- fi
- continue
- fi
-
- option=`echo $option | tr '_' '-'`
- if [ -n "$value" ]; then
- DAEMONARGS="$DAEMONARGS --$option $value"
- fi
- done
- echo -n " $name"
- local status="OK"
- $BIN --write-pid "$RUN_D/$BIN.$name.pid" $DAEMONARGS || status="failed"
- echo -n "($status)"
-}
-
-start() {
- echo -n "Starting $DESC:"
- config_load uanytun
- config_foreach foreach_config ""
- echo "."
-}
-
-stop() {
- echo -n "Stopping $DESC:"
- local name
- local pidfile
-
- for pidfile in `ls $RUN_D/$BIN.*.pid 2> /dev/null`; do
- name=${pidfile%%.pid}
- name=${name##$RUN_D/$BIN.}
- echo -n " $name"
- kill `cat $pidfile` || true
- rm -f $pidfile
- done
- echo "."
-}