瀏覽代碼

Babel script

Bob Mottram 10 年之前
父節點
當前提交
e4b4115b9a
共有 1 個檔案被更改,包括 13 行新增1 行删除
  1. 13
    1
      src/freedombone

+ 13
- 1
src/freedombone 查看文件

1582
   if [[ $ENABLE_BABEL != "yes" ]]; then
1582
   if [[ $ENABLE_BABEL != "yes" ]]; then
1583
       return
1583
       return
1584
   fi
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
   echo 'mesh_babel' >> $COMPLETION_FILE
1598
   echo 'mesh_babel' >> $COMPLETION_FILE
1587
 }
1599
 }
1588
 
1600