diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index 77490b1..f06ed5d 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -94,7 +94,7 @@ sudo ip6tables -P FORWARD DROP sudo ip6tables -P OUTPUT ACCEPT # iptables-persistent -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then if [ ! "$(dpkg-query -l iptables-persistent)" ]; then echo "Installing iptables-persistent" @@ -110,7 +110,7 @@ if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ras echo "Saving ip6tables rules" sudo bash -c "ip6tables-save > /etc/iptables/rules.v6" fi -else +elif [ "$DISTRO" == "arch" ]; then echo "Saving iptables rules" sudo bash -c "iptables-save > /etc/iptables/rules.v4" echo "Saving ip6tables rules" @@ -118,7 +118,7 @@ else fi # IP forwarding -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf sudo sysctl -p /etc/sysctl.conf elif [ "$DISTRO" == "arch" ]; then @@ -127,7 +127,7 @@ elif [ "$DISTRO" == "arch" ]; then fi # rsyslog to create /var/log/iptables.log -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then sudo cp ./scripts/conf/15-iptables.conf /etc/rsyslog.d/ sudo chown root:root /etc/rsyslog.d/15-iptables.conf sudo systemctl restart rsyslog