From fad60932b75c58418902d47b24c080718f5f4933 Mon Sep 17 00:00:00 2001 From: glen Date: Sun, 9 May 2021 06:57:01 -0400 Subject: [PATCH] grep for entry --- installers/common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installers/common.sh b/installers/common.sh index 596684b..56b2e00 100644 --- a/installers/common.sh +++ b/installers/common.sh @@ -145,7 +145,8 @@ function configure_exit() { sed -i 's#\#ifaddr=#ifaddr=172.16.0.1/16#g' /var/lib/lokinet/lokinet.ini sed -i 's#\#paths=6#paths=8#g' /var/lib/lokinet/lokinet.ini sed -i 's#\#net.ipv4.ip_forward=1#net.ipv4.ip_forward = 1#g' /etc/sysctl.conf - iptables -t nat -A POSTROUTING -s 172.16.0.1/16 -o eth0 -j MASQUERADE + if [ -z $(grep "-A POSTROUTING -s 172.16.0.1/16 -o eth0 -j MASQUERADE" "/etc/iptables/rules.v4") ]; then iptables -t nat -A POSTROUTING -s 172.16.0.1/16 -o eth0 -j MASQUERADE; fi +# iptables -t nat -A POSTROUTING -s 172.16.0.1/16 -o eth0 -j MASQUERADE iptables-save > /etc/iptables/rules.v4 sudo sysctl -p /etc/sysctl.conf sudo systemctl restart lokinet