Browse Source

Babel script

Bob Mottram 10 years ago
parent
commit
e4b4115b9a
1 changed files with 13 additions and 1 deletions
  1. 13
    1
      src/freedombone

+ 13
- 1
src/freedombone View File

@@ -1582,7 +1582,19 @@ function mesh_babel {
1582 1582
   if [[ $ENABLE_BABEL != "yes" ]]; then
1583 1583
       return
1584 1584
   fi
1585
-  apt-get install babeld
1585
+  apt-get -y install babeld
1586
+
1587
+  numarray=( 1 2 3 4 5 6 7 8 9 0 )
1588
+  a=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]}
1589
+  b=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]}
1590
+  echo '#!/bin/sh' > /usr/bin/mesh-babel
1591
+  echo 'systemctl stop networking' >> /usr/bin/mesh-babel
1592
+  echo 'iwconfig wlan0 mode ad-hoc channel 11 essid “mesh"' >> /usr/bin/mesh-babel
1593
+  echo 'ifconfig wlan0 up' >> /usr/bin/mesh-babel
1594
+  echo "ifconfig wlan0 192.168.$a.$b netmask 255.255.255.0 broadcast 192.168.13.255" >> /usr/bin/mesh-babel
1595
+  echo 'babeld -d 5 wlan0' >> /usr/bin/mesh-babel
1596
+  echo 'exit 0' >> /usr/bin/mesh-babel
1597
+
1586 1598
   echo 'mesh_babel' >> $COMPLETION_FILE
1587 1599
 }
1588 1600