Selaa lähdekoodia

zeronet port for mesh peers

Bob Mottram 10 vuotta sitten
vanhempi
commit
8ab2707f62
1 muutettua tiedostoa jossa 18 lisäystä ja 0 poistoa
  1. 18
    0
      src/freedombone

+ 18
- 0
src/freedombone Näytä tiedosto

401
 #)
401
 #)
402
 
402
 
403
 ZERONET_REPO='https://github.com/HelloZeroNet/ZeroNet.git'
403
 ZERONET_REPO='https://github.com/HelloZeroNet/ZeroNet.git'
404
+ZERONET_PORT=15441
404
 
405
 
405
 # Default diffie-hellman key length in bits
406
 # Default diffie-hellman key length in bits
406
 DH_KEYLENGTH=1024
407
 DH_KEYLENGTH=1024
759
   fi
760
   fi
760
 
761
 
761
   if [ -f $CONFIGURATION_FILE ]; then
762
   if [ -f $CONFIGURATION_FILE ]; then
763
+      if grep -q "ZERONET_PORT" $CONFIGURATION_FILE; then
764
+          ZERONET_PORT=$(grep "ZERONET_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
765
+      fi
762
       if grep -q "DH_KEYLENGTH" $CONFIGURATION_FILE; then
766
       if grep -q "DH_KEYLENGTH" $CONFIGURATION_FILE; then
763
           DH_KEYLENGTH=$(grep "DH_KEYLENGTH" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
767
           DH_KEYLENGTH=$(grep "DH_KEYLENGTH" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
764
       fi
768
       fi
5982
   echo 'configure_firewall_for_babel' >> $COMPLETION_FILE
5986
   echo 'configure_firewall_for_babel' >> $COMPLETION_FILE
5983
 }
5987
 }
5984
 
5988
 
5989
+function configure_firewall_for_zeronet {
5990
+  if grep -Fxq "configure_firewall_for_zeronet" $COMPLETION_FILE; then
5991
+      return
5992
+  fi
5993
+  if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
5994
+      return
5995
+  fi
5996
+  iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport $ZERONET_PORT -j ACCEPT
5997
+  iptables -A INPUT -i $WIFI_INTERFACE -p tcp --dport $ZERONET_PORT -j ACCEPT
5998
+  save_firewall_settings
5999
+  echo 'configure_firewall_for_zeronet' >> $COMPLETION_FILE
6000
+}
6001
+
5985
 function configure_firewall_for_dlna {
6002
 function configure_firewall_for_dlna {
5986
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
6003
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
5987
       return
6004
       return
10304
 configure_firewall_for_web_access
10321
 configure_firewall_for_web_access
10305
 configure_firewall_for_voip
10322
 configure_firewall_for_voip
10306
 configure_firewall_for_avahi
10323
 configure_firewall_for_avahi
10324
+configure_firewall_for_zeronet
10307
 remove_proprietary_repos
10325
 remove_proprietary_repos
10308
 change_debian_repos
10326
 change_debian_repos
10309
 enable_backports
10327
 enable_backports