Browse Source

Enable ipv6 when i2p is installed

Bob Mottram 7 years ago
parent
commit
6a54a30e50
2 changed files with 15 additions and 1 deletions
  1. 1
    1
      src/freedombone-utils-firewall
  2. 14
    0
      src/freedombone-utils-i2p

+ 1
- 1
src/freedombone-utils-firewall View File

@@ -265,7 +265,7 @@ function configure_internet_protocol {
265 265
     if ! grep -q "ignore pings" /etc/sysctl.conf; then
266 266
         echo '# ignore pings' >> /etc/sysctl.conf
267 267
         echo 'net.ipv4.icmp_echo_ignore_all = 1' >> /etc/sysctl.conf
268
-        echo 'net.ipv6.icmp_echo_ignore_all = 1' >> /etc/sysctl.conf
268
+        #echo 'net.ipv6.icmp_echo_ignore_all = 1' >> /etc/sysctl.conf
269 269
     fi
270 270
     if ! grep -q "disable ipv6" /etc/sysctl.conf; then
271 271
         echo '# disable ipv6' >> /etc/sysctl.conf

+ 14
- 0
src/freedombone-utils-i2p View File

@@ -53,10 +53,24 @@ function install_i2p {
53 53
     echo "deb https://${I2P_DOMAIN}/ stretch main" > /etc/apt/sources.list.d/i2p.list
54 54
     echo "deb-src https://${I2P_DOMAIN}/ stretch main" >> /etc/apt/sources.list.d/i2p.list
55 55
 
56
+    # i2p needs ipv6 to be enabled
57
+    sed -i 's|net.ipv6.conf.all.disable_ipv6.*|net.ipv6.conf.all.disable_ipv6 = 0|g' /etc/sysctl.conf
58
+    /sbin/sysctl -p -q
59
+
56 60
     apt-get update
57 61
     apt-get -yq install i2p i2p-keyring
58 62
 }
59 63
 
60 64
 function remove_i2p {
61 65
     apt-get -yq remove i2p i2p-keyring --purge
66
+
67
+    # It's assumed here that ipv6 is only needed for i2p
68
+    # This might not be true in future
69
+    sed -i 's|net.ipv6.conf.all.disable_ipv6.*|net.ipv6.conf.all.disable_ipv6 = 1|g' /etc/sysctl.conf
70
+    /sbin/sysctl -p -q
71
+}
72
+
73
+function i2p_enable_sam {
74
+    sed -i 's|clientApp.1.startOnLoad=.*|clientApp.1.startOnLoad=true|g' /var/lib/i2p/i2p-config/clients.config
75
+    systemctl restart i2p
62 76
 }