Bob Mottram преди 9 години
родител
ревизия
32c290857e
променени са 1 файла, в които са добавени 26 реда и са изтрити 5 реда
  1. 26
    5
      src/freedombone

+ 26
- 5
src/freedombone Целия файл

1626
   echo '# stop network manager to make the mesh network work' >> /usr/bin/mesh
1626
   echo '# stop network manager to make the mesh network work' >> /usr/bin/mesh
1627
   echo 'service networking stop' >> /usr/bin/mesh
1627
   echo 'service networking stop' >> /usr/bin/mesh
1628
   echo '' >> /usr/bin/mesh
1628
   echo '' >> /usr/bin/mesh
1629
-  echo '# configure the wlan interface to operate with mtus of 1532(batman requires it) and turn enc off to ensure it works' >> /usr/bin/mesh
1629
+  echo -n '# configure the wlan interface to operate with ' >> /usr/bin/mesh
1630
+  echo 'mtus of 1532(batman requires it) and turn enc off ' >> /usr/bin/mesh
1631
+  echo 'to ensure it works' >> /usr/bin/mesh
1630
   echo 'ifconfig wlan0 down' >> /usr/bin/mesh
1632
   echo 'ifconfig wlan0 down' >> /usr/bin/mesh
1631
   echo 'ifconfig wlan0 mtu 1532' >> /usr/bin/mesh
1633
   echo 'ifconfig wlan0 mtu 1532' >> /usr/bin/mesh
1632
   echo 'iwconfig wlan0 enc off' >> /usr/bin/mesh
1634
   echo 'iwconfig wlan0 enc off' >> /usr/bin/mesh
1633
   echo '' >> /usr/bin/mesh
1635
   echo '' >> /usr/bin/mesh
1634
   echo '# add the interface to the ad-hoc network - or create it.' >> /usr/bin/mesh
1636
   echo '# add the interface to the ad-hoc network - or create it.' >> /usr/bin/mesh
1635
-  echo "iwconfig wlan0 mode ad-hoc essid mesh-$MESH_ESSID ap $BATMAN_IPV6 channel 2" >> /usr/bin/mesh
1637
+  echo -n "iwconfig wlan0 mode ad-hoc essid mesh-$MESH_ESSID ap " >> /usr/bin/mesh
1638
+  echo "$BATMAN_IPV6 channel 2" >> /usr/bin/mesh
1636
   echo '' >> /usr/bin/mesh
1639
   echo '' >> /usr/bin/mesh
1637
-  echo '# add wlan0 to the batman-adv virtual interface(so it can communicate with other batman-adv nodes)' >> /usr/bin/mesh
1640
+  echo -n '# add wlan0 to the batman-adv virtual interface(so it can ' >> /usr/bin/mesh
1641
+  echo 'communicate with other batman-adv nodes)' >> /usr/bin/mesh
1638
   echo 'batctl if add wlan0' >> /usr/bin/mesh
1642
   echo 'batctl if add wlan0' >> /usr/bin/mesh
1639
   echo 'ifconfig wlan0 up' >> /usr/bin/mesh
1643
   echo 'ifconfig wlan0 up' >> /usr/bin/mesh
1640
   echo 'ifconfig bat0 up' >> /usr/bin/mesh
1644
   echo 'ifconfig bat0 up' >> /usr/bin/mesh
1641
   echo '' >> /usr/bin/mesh
1645
   echo '' >> /usr/bin/mesh
1642
-  echo '# make the bridge linking the batman-adv virtual interface to the ethernet port' >> /usr/bin/mesh
1646
+  echo -n '# make the bridge linking the batman-adv virtual ' >> /usr/bin/mesh
1647
+  echo 'interface to the ethernet port' >> /usr/bin/mesh
1643
   echo 'brctl addbr bridge-link' >> /usr/bin/mesh
1648
   echo 'brctl addbr bridge-link' >> /usr/bin/mesh
1644
   echo 'brctl addif bridge-link bat0' >> /usr/bin/mesh
1649
   echo 'brctl addif bridge-link bat0' >> /usr/bin/mesh
1645
   echo 'brctl addif bridge-link eth0' >> /usr/bin/mesh
1650
   echo 'brctl addif bridge-link eth0' >> /usr/bin/mesh
1646
   echo '' >> /usr/bin/mesh
1651
   echo '' >> /usr/bin/mesh
1647
-  echo '#get the ip address for the bridge from the dhcp server' >> /usr/bin/mesh
1652
+  echo '# get the ip address for the bridge from the dhcp server' >> /usr/bin/mesh
1648
   echo 'dhclient bridge-link' >> /usr/bin/mesh
1653
   echo 'dhclient bridge-link' >> /usr/bin/mesh
1649
   echo '' >> /usr/bin/mesh
1654
   echo '' >> /usr/bin/mesh
1650
   echo 'exit 0' >> /usr/bin/mesh
1655
   echo 'exit 0' >> /usr/bin/mesh
5465
   echo 'configure_firewall_for_cjdns' >> $COMPLETION_FILE
5470
   echo 'configure_firewall_for_cjdns' >> $COMPLETION_FILE
5466
 }
5471
 }
5467
 
5472
 
5473
+function configure_firewall_for_batman {
5474
+  if grep -Fxq "configure_firewall_for_batman" $COMPLETION_FILE; then
5475
+      return
5476
+  fi
5477
+  if [[ $ENABLE_BATMAN != "yes" ]]; then
5478
+      return
5479
+  fi
5480
+  # DHCP
5481
+  #iptables -A INPUT -i eth0 -p udp --dport 547 -j ACCEPT
5482
+  # BATMAN
5483
+  #iptables -A INPUT -i eth0 -p udp --dport 1966 -j ACCEPT
5484
+  save_firewall_settings
5485
+  echo 'configure_firewall_for_batman' >> $COMPLETION_FILE
5486
+}
5487
+
5468
 function configure_firewall_for_dlna {
5488
 function configure_firewall_for_dlna {
5469
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
5489
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
5470
       return
5490
       return
9720
 configure_firewall_for_ftp
9740
 configure_firewall_for_ftp
9721
 configure_firewall_for_web_access
9741
 configure_firewall_for_web_access
9722
 configure_firewall_for_cjdns
9742
 configure_firewall_for_cjdns
9743
+configure_firewall_for_batman
9723
 configure_firewall_for_voip
9744
 configure_firewall_for_voip
9724
 remove_proprietary_repos
9745
 remove_proprietary_repos
9725
 change_debian_repos
9746
 change_debian_repos