diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index 7a80060..7212043 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -113,8 +113,11 @@ fi # IP forwarding sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf -sudo sed -i 's/.*vm.overcommit_memory.*/d' /etc/sysctl.conf -echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf + +# VM Overcommit Memory +grep -i "vm.overcommit_memory" /etc/sysctl.conf && sed -i 's/.*vm.overcommit_memory.*/vm.overcommit_memory=1/' /etc/sysctl.conf || echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf + +# Force re-read of sysctl.conf sudo sysctl -p /etc/sysctl.conf # rsyslog to create /var/log/iptables.log