瀏覽代碼

Beginning of babel mesh

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

+ 38
- 1
src/freedombone 查看文件

@@ -378,6 +378,9 @@ CJDNS_PORT=
378 378
 ENABLE_BATMAN="no"
379 379
 BATMAN_IPV6=
380 380
 
381
+# Babel mesh
382
+ENABLE_BABEL="no"
383
+
381 384
 # social key management
382 385
 ENABLE_SOCIAL_KEY_MANAGEMENT="no"
383 386
 
@@ -646,6 +649,11 @@ else
646 649
     shift
647 650
     ENABLE_BATMAN="yes"
648 651
     ;;
652
+    # Enable Babel
653
+    --babel)
654
+    shift
655
+    ENABLE_BABEL="yes"
656
+    ;;
649 657
     # VoIP server password
650 658
     --vpass)
651 659
     shift
@@ -844,6 +852,9 @@ function read_configuration {
844 852
       if grep -q "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE; then
845 853
           LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
846 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 858
       if grep -q "ENABLE_BATMAN" $CONFIGURATION_FILE; then
848 859
           ENABLE_BATMAN=$(grep "ENABLE_BATMAN" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
849 860
       fi
@@ -1564,6 +1575,17 @@ function get_batman_ipv6_address {
1564 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 1589
 function mesh_batman_bridge {
1568 1590
   # https://sudoroom.org/wiki/Mesh/Relay_setup
1569 1591
   # also see http://www.netlore.co.uk/airmesh/
@@ -1616,7 +1638,7 @@ function mesh_batman_bridge {
1616 1638
   echo '#!/bin/bash' > /usr/bin/mesh
1617 1639
   echo '' > /usr/bin/mesh
1618 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 1642
   echo '' >> /usr/bin/mesh
1621 1643
   echo -n '# configure the wlan interface to operate with ' >> /usr/bin/mesh
1622 1644
   echo 'mtus of 1532(batman requires it) and turn enc off ' >> /usr/bin/mesh
@@ -5480,6 +5502,19 @@ function configure_firewall_for_batman {
5480 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 5518
 function configure_firewall_for_dlna {
5484 5519
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
5485 5520
       return
@@ -9744,6 +9779,7 @@ configure_firewall_for_ftp
9744 9779
 configure_firewall_for_web_access
9745 9780
 configure_firewall_for_cjdns
9746 9781
 configure_firewall_for_batman
9782
+configure_firewall_for_babel
9747 9783
 configure_firewall_for_voip
9748 9784
 remove_proprietary_repos
9749 9785
 change_debian_repos
@@ -9765,6 +9801,7 @@ create_git_project
9765 9801
 mesh_cjdns
9766 9802
 mesh_cjdns_tools
9767 9803
 mesh_batman_bridge
9804
+mesh_babel
9768 9805
 backup_github_projects
9769 9806
 configure_ssh
9770 9807
 remove_instructions_from_motd