File tree Expand file tree Collapse file tree 7 files changed +42
-0
lines changed
Expand file tree Collapse file tree 7 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ iptables="/sbin/iptables"
2424
2525# Includes
2626source $HESTIA /func/main.sh
27+ source $HESTIA /func/firewall.sh
2728source $HESTIA /conf/hestia.conf
2829
2930
@@ -43,6 +44,9 @@ check_hestia_demo_mode
4344# Action #
4445# ----------------------------------------------------------#
4546
47+ # Self heal iptables links
48+ heal_iptables_links
49+
4650# Checking server ip
4751if [ -e " $HESTIA /data/ips/$ip " ] || [ " $ip " = ' 127.0.0.1' ]; then
4852 exit
Original file line number Diff line number Diff line change 3232
3333# Includes
3434source $HESTIA /func/main.sh
35+ source $HESTIA /func/firewall.sh
3536source $HESTIA /conf/hestia.conf
3637
3738
@@ -50,6 +51,9 @@ check_hestia_demo_mode
5051# Action #
5152# ----------------------------------------------------------#
5253
54+ # Self heal iptables links
55+ heal_iptables_links
56+
5357# Checking known chains
5458case $chain in
5559 SSH) # Get ssh port by reading ssh config file.
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ iptables="/sbin/iptables"
2424
2525# Includes
2626source $HESTIA /func/main.sh
27+ source $HESTIA /func/firewall.sh
2728source $HESTIA /conf/hestia.conf
2829
2930
@@ -43,6 +44,9 @@ check_hestia_demo_mode
4344# Action #
4445# ----------------------------------------------------------#
4546
47+ # Self heal iptables links
48+ heal_iptables_links
49+
4650# Checking ip in banlist
4751conf=" $HESTIA /data/firewall/banlist.conf"
4852check_ip=$( grep " IP='$ip ' CHAIN='$chain '" $conf 2> /dev/null)
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ iptables="/sbin/iptables"
2323
2424# Includes
2525source $HESTIA /func/main.sh
26+ source $HESTIA /func/firewall.sh
2627source $HESTIA /conf/hestia.conf
2728
2829
@@ -42,6 +43,9 @@ check_hestia_demo_mode
4243# Action #
4344# ----------------------------------------------------------#
4445
46+ # Self heal iptables links
47+ heal_iptables_links
48+
4549# Deleting chain
4650chains=$HESTIA /data/firewall/chains.conf
4751banlist=$HESTIA /data/firewall/banlist.conf
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ modprobe="/sbin/modprobe"
1717# Includes
1818source /etc/profile.d/hestia.sh
1919source $HESTIA /func/main.sh
20+ source $HESTIA /func/firewall.sh
2021source $HESTIA /conf/hestia.conf
2122
2223
@@ -34,6 +35,9 @@ check_hestia_demo_mode
3435# Action #
3536# ----------------------------------------------------------#
3637
38+ # Self heal iptables links
39+ heal_iptables_links
40+
3741# Creating temporary file
3842tmp=$( mktemp)
3943
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ sysctl="/sbin/sysctl"
1818# Includes
1919source /etc/profile.d/hestia.sh
2020source $HESTIA /func/main.sh
21+ source $HESTIA /func/firewall.sh
2122source $HESTIA /conf/hestia.conf
2223
2324
@@ -32,6 +33,9 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
3233# Action #
3334# ----------------------------------------------------------#
3435
36+ # Self heal iptables links
37+ heal_iptables_links
38+
3539# Checking local IPv4 rules
3640rules=" $HESTIA /data/firewall/rules.conf"
3741
Original file line number Diff line number Diff line change 1+
2+ heal_iptables_links () {
3+ packages=" iptables iptables-save iptables-restore"
4+ for package in $packages ; do
5+ if [ ! -e " /sbin/${package} " ]; then
6+ if which ${package} ; then
7+ ln -s " $( which ${package} ) " /sbin/${package}
8+ elif [ -e " /usr/sbin/${package} " ]; then
9+ ln -s /usr/sbin/${package} /sbin/${package}
10+ elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package} ; then
11+ autoiptables=$( whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package} | cut -d ' ' -f 2)
12+ if [ -x " $autoiptables " ]; then
13+ ln -s " $autoiptables " /sbin/${package}
14+ fi
15+ fi
16+ fi
17+ done
18+ }
You can’t perform that action at this time.
0 commit comments