From e4b4115b9a7b46ecd2337438d549d2ea9449ac14 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 21 Jul 2015 23:17:59 +0100 Subject: [PATCH] Babel script --- src/freedombone | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/freedombone b/src/freedombone index 0b065bb7..8d879828 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1582,7 +1582,19 @@ function mesh_babel { if [[ $ENABLE_BABEL != "yes" ]]; then return fi - apt-get install babeld + apt-get -y install babeld + + numarray=( 1 2 3 4 5 6 7 8 9 0 ) + a=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]} + b=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]} + echo '#!/bin/sh' > /usr/bin/mesh-babel + echo 'systemctl stop networking' >> /usr/bin/mesh-babel + echo 'iwconfig wlan0 mode ad-hoc channel 11 essid “mesh"' >> /usr/bin/mesh-babel + echo 'ifconfig wlan0 up' >> /usr/bin/mesh-babel + echo "ifconfig wlan0 192.168.$a.$b netmask 255.255.255.0 broadcast 192.168.13.255" >> /usr/bin/mesh-babel + echo 'babeld -d 5 wlan0' >> /usr/bin/mesh-babel + echo 'exit 0' >> /usr/bin/mesh-babel + echo 'mesh_babel' >> $COMPLETION_FILE }