#! /bin/bash # Rocky9 compatible . /usr/src/m2/framework/bash_functions.sh k_detect_os if [[ $ROCKY9 == 1 ]]; then exit; fi # no need to fix on R9 if ((centos_version == 6)); then [[ ! -e /etc/init.d/iptables ]] && exit 1 if ! diff /etc/init.d/iptables /usr/src/m2/helpers/iptables/services/iptables.init_modified_C6 &>/dev/null; then cp -f /usr/src/m2/helpers/iptables/services/iptables.init_modified_C6 /etc/init.d/iptables chmod 0755 /etc/init.d/iptables chkconfig --level 2345 iptables on else chkconfig --level 2345 iptables on fi else [[ ! -e /usr/libexec/iptables/iptables.init ]] && exit 1 if ! diff /usr/libexec/iptables/iptables.init /usr/src/m2/helpers/iptables/services/iptables.init_modified_C7 &>/dev/null; then cp -f /usr/src/m2/helpers/iptables/services/iptables.init_modified_C7 /usr/libexec/iptables/iptables.init chmod 0755 /usr/libexec/iptables/iptables.init fi fi