Selaa lähdekoodia

Beginning of babel mesh

Bob Mottram 10 vuotta sitten
vanhempi
commit
834e64f8b4
1 muutettua tiedostoa jossa 38 lisäystä ja 1 poistoa
  1. 38
    1
      src/freedombone

+ 38
- 1
src/freedombone Näytä tiedosto

378
 ENABLE_BATMAN="no"
378
 ENABLE_BATMAN="no"
379
 BATMAN_IPV6=
379
 BATMAN_IPV6=
380
 
380
 
381
+# Babel mesh
382
+ENABLE_BABEL="no"
383
+
381
 # social key management
384
 # social key management
382
 ENABLE_SOCIAL_KEY_MANAGEMENT="no"
385
 ENABLE_SOCIAL_KEY_MANAGEMENT="no"
383
 
386
 
646
     shift
649
     shift
647
     ENABLE_BATMAN="yes"
650
     ENABLE_BATMAN="yes"
648
     ;;
651
     ;;
652
+    # Enable Babel
653
+    --babel)
654
+    shift
655
+    ENABLE_BABEL="yes"
656
+    ;;
649
     # VoIP server password
657
     # VoIP server password
650
     --vpass)
658
     --vpass)
651
     shift
659
     shift
844
       if grep -q "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE; then
852
       if grep -q "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE; then
845
           LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
853
           LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
846
       fi
854
       fi
855
+      if grep -q "ENABLE_BABEL" $CONFIGURATION_FILE; then
856
+          ENABLE_BABEL=$(grep "ENABLE_BABEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
857
+      fi
847
       if grep -q "ENABLE_BATMAN" $CONFIGURATION_FILE; then
858
       if grep -q "ENABLE_BATMAN" $CONFIGURATION_FILE; then
848
           ENABLE_BATMAN=$(grep "ENABLE_BATMAN" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
859
           ENABLE_BATMAN=$(grep "ENABLE_BATMAN" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
849
       fi
860
       fi
1564
   fi
1575
   fi
1565
 }
1576
 }
1566
 
1577
 
1578
+function mesh_babel {
1579
+  if grep -Fxq "mesh_babel" $COMPLETION_FILE; then
1580
+      return
1581
+  fi
1582
+  if [[ $ENABLE_BABEL != "yes" ]]; then
1583
+      return
1584
+  fi
1585
+  apt-get install babeld
1586
+  echo 'mesh_babel' >> $COMPLETION_FILE
1587
+}
1588
+
1567
 function mesh_batman_bridge {
1589
 function mesh_batman_bridge {
1568
   # https://sudoroom.org/wiki/Mesh/Relay_setup
1590
   # https://sudoroom.org/wiki/Mesh/Relay_setup
1569
   # also see http://www.netlore.co.uk/airmesh/
1591
   # also see http://www.netlore.co.uk/airmesh/
1616
   echo '#!/bin/bash' > /usr/bin/mesh
1638
   echo '#!/bin/bash' > /usr/bin/mesh
1617
   echo '' > /usr/bin/mesh
1639
   echo '' > /usr/bin/mesh
1618
   echo '# stop network manager to make the mesh network work' >> /usr/bin/mesh
1640
   echo '# stop network manager to make the mesh network work' >> /usr/bin/mesh
1619
-  echo 'service networking stop' >> /usr/bin/mesh
1641
+  echo 'systemctl stop networking' >> /usr/bin/mesh
1620
   echo '' >> /usr/bin/mesh
1642
   echo '' >> /usr/bin/mesh
1621
   echo -n '# configure the wlan interface to operate with ' >> /usr/bin/mesh
1643
   echo -n '# configure the wlan interface to operate with ' >> /usr/bin/mesh
1622
   echo 'mtus of 1532(batman requires it) and turn enc off ' >> /usr/bin/mesh
1644
   echo 'mtus of 1532(batman requires it) and turn enc off ' >> /usr/bin/mesh
5480
   echo 'configure_firewall_for_batman' >> $COMPLETION_FILE
5502
   echo 'configure_firewall_for_batman' >> $COMPLETION_FILE
5481
 }
5503
 }
5482
 
5504
 
5505
+function configure_firewall_for_babel {
5506
+  if grep -Fxq "configure_firewall_for_babel" $COMPLETION_FILE; then
5507
+      return
5508
+  fi
5509
+  if [[ $ENABLE_BABEL != "yes" ]]; then
5510
+      return
5511
+  fi
5512
+  # DHCP
5513
+  #iptables -A INPUT -i eth0 -p udp --dport 547 -j ACCEPT
5514
+  #save_firewall_settings
5515
+  echo 'configure_firewall_for_babel' >> $COMPLETION_FILE
5516
+}
5517
+
5483
 function configure_firewall_for_dlna {
5518
 function configure_firewall_for_dlna {
5484
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
5519
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
5485
       return
5520
       return
9744
 configure_firewall_for_web_access
9779
 configure_firewall_for_web_access
9745
 configure_firewall_for_cjdns
9780
 configure_firewall_for_cjdns
9746
 configure_firewall_for_batman
9781
 configure_firewall_for_batman
9782
+configure_firewall_for_babel
9747
 configure_firewall_for_voip
9783
 configure_firewall_for_voip
9748
 remove_proprietary_repos
9784
 remove_proprietary_repos
9749
 change_debian_repos
9785
 change_debian_repos
9765
 mesh_cjdns
9801
 mesh_cjdns
9766
 mesh_cjdns_tools
9802
 mesh_cjdns_tools
9767
 mesh_batman_bridge
9803
 mesh_batman_bridge
9804
+mesh_babel
9768
 backup_github_projects
9805
 backup_github_projects
9769
 configure_ssh
9806
 configure_ssh
9770
 remove_instructions_from_motd
9807
 remove_instructions_from_motd