|
|
|
@ -1,8 +1,6 @@
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
# info: update system firewall rules
|
|
|
|
|
# options: NEED_IPT_SWITCH
|
|
|
|
|
# if first parameter set and it's value is iptables
|
|
|
|
|
# for rpm system, then need to activate iptables
|
|
|
|
|
# options: no opts
|
|
|
|
|
#
|
|
|
|
|
# example: v-update-firewall
|
|
|
|
|
#
|
|
|
|
@ -11,7 +9,6 @@
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
# Variables & Functions #
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
need_ipt_switch="$1"
|
|
|
|
|
|
|
|
|
|
# Defining absolute path for iptables and modprobe
|
|
|
|
|
iptables="/sbin/iptables"
|
|
|
|
@ -39,15 +36,6 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
|
|
|
|
|
# Action #
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
|
|
|
|
if [ -f /etc/redhat-release ] && [ "$need_ipt_switch" = "iptables" ]; then
|
|
|
|
|
# Revert from nftables to iptables only first time
|
|
|
|
|
systemctl stop firewalld
|
|
|
|
|
systemctl disable firewalld
|
|
|
|
|
dnf erase nftables -y
|
|
|
|
|
dnf install iptables-legacy iptables-legacy-libs iptables-services iptables-utils ipset -y
|
|
|
|
|
systemctl enable iptables --now
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Self heal iptables links
|
|
|
|
|
heal_iptables_links
|
|
|
|
|
|
|
|
|
|