forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirewall.sh
More file actions
18 lines (17 loc) · 721 Bytes
/
firewall.sh
File metadata and controls
18 lines (17 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
}