You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hestiacp/func/firewall.sh

26 lines
992 B

#!/bin/bash
#===========================================================================#
# #
# Hestia Control Panel - Firewall Function Library #
# #
#===========================================================================#
heal_iptables_links() {
packages="iptables iptables-save iptables-restore"
for package in $packages; do
if [ ! -e "/sbin/${package}" ]; then
if which ${package}; then
ln -s "$(which ${package})" /sbin/${package}
elif [ -e "/usr/sbin/${package}" ]; then
ln -s /usr/sbin/${package} /sbin/${package}
elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package}; then
autoiptables=$(whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package} | cut -d '' -f 2)
if [ -x "$autoiptables" ]; then
ln -s "$autoiptables" /sbin/${package}
fi
fi
fi
done
}