summaryrefslogtreecommitdiff
path: root/files/common/etc/fsm/inetable/trans/robinson.enter
diff options
context:
space:
mode:
Diffstat (limited to 'files/common/etc/fsm/inetable/trans/robinson.enter')
-rwxr-xr-xfiles/common/etc/fsm/inetable/trans/robinson.enter31
1 files changed, 31 insertions, 0 deletions
diff --git a/files/common/etc/fsm/inetable/trans/robinson.enter b/files/common/etc/fsm/inetable/trans/robinson.enter
new file mode 100755
index 0000000..7ea0001
--- /dev/null
+++ b/files/common/etc/fsm/inetable/trans/robinson.enter
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+# setup random ip
+gen_randnet () {
+ randnet=21.$(($RANDOM % 256)).$(($RANDOM % 256))
+}
+
+gen_randnet
+while ! arping -I br-mesh -D -c 5 -q $randnet.1; do
+ gen_randnet
+done
+ifconfig br-mesh $randnet.1
+
+# setup dhcp
+echo "
+set dhcp.mesh=dhcp
+set dhcp.mesh.start=2
+set dhcp.mesh.limit=254
+set dhcp.mesh.leasetime=60
+set dhcp.mesh.interface=mesh
+set dhcp.mesh.start_ip=$randnet.2
+set dhcp.mesh.end_ip=$randnet.254
+" | uci batch
+/etc/init.d/dnsmasq restart
+
+# announce fake gateway; TODO: announce only tiny bandwith
+batctl gw server
+
+# TODO: start fake dns
+
+# TODO: redirect all inet traffic to local httpd
contact: Jan Huwald // Impressum