packages/net/n2n/files/n2n.init
thepeople f99c98092f add n2n
git-svn-id: svn://svn.openwrt.org/openwrt/packages@11760 3c298f89-4303-0410-b956-a3cf2f4a3e73
2008-07-10 02:34:06 +00:00

38 lines
740 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2008 OpenWrt.org
START=90
config_cb() {
local cfg="$CONFIG_SECTION"
config_get configname "$cfg" TYPE
case "$configname" in
edge)
config_get ipaddr "$cfg" ipaddr
config_get supernode "$cfg" supernode
config_get port "$cfg" port
config_get community "$cfg" community
config_get key "$cfg" key
config_get_bool route "$cfg" route 0
[ "$route" = "1" ] && args='-r'
if [ "$ipaddr" != "" ]; then
edge -f $args -a $ipaddr -c $community -k $key -l ${supernode}:${port}
fi
;;
supernode)
config_get port "$cfg" port
if [ "$port" != "" ]; then
supernode -l $port &
fi
;;
esac
}
start() {
config_load n2n
}
stop() {
killall edge
killall supernode
}