summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorDarkeye <postfach@martinmichel.info>2011-02-22 13:18:46 (GMT)
committerDarkeye <postfach@martinmichel.info>2011-02-22 13:18:46 (GMT)
commit596ccd798cdeeaa35ce98b3249cac0b713b05fe6 (patch)
tree4f46259be74f684f0ae1854bf6cf7e51b1c66688 /files
parentf35eabaf6f17f6ed52ce437316c6a0f2b968f30b (diff)
N2N Changes:
n2n starts as tap device n2n use always ip 169.254.0.1 n2n clear ipv4 ip after start n2n-tap is added in batctl if add use workaround: ip 0.0.0.0 to del ipv4
Diffstat (limited to 'files')
-rwxr-xr-xfiles/etc/init.d/n2n40
1 files changed, 40 insertions, 0 deletions
diff --git a/files/etc/init.d/n2n b/files/etc/init.d/n2n
new file mode 100755
index 0000000..929f463
--- /dev/null
+++ b/files/etc/init.d/n2n
@@ -0,0 +1,40 @@
+#!/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
+ config_get devname "$cfg" devname
+ [ "$route" = "1" ] && args='-r'
+ if [ "$ipaddr" != "" ]; then
+ edge -f $args -a 169.254.0.1 -d $devname -c $community -k $key -l ${supernode}:${port}
+ ifconfig $devname 0.0.0.0
+ batctl if add $devname
+ fi
+ ;;
+ supernode)
+ config_get port "$cfg" port
+ if [ "$port" != "" ]; then
+ supernode -l $port &
+ fi
+ ;;
+ esac
+}
+
+start() {
+ config_load n2n
+}
+stop() {
+ killall edge
+ killall supernode
+}
contact: Jan Huwald // Impressum