File tree Expand file tree Collapse file tree 11 files changed +53
-3
lines changed
Expand file tree Collapse file tree 11 files changed +53
-3
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 @@ -19,6 +19,7 @@ modprobe="/sbin/modprobe"
1919# Includes
2020source /etc/profile.d/hestia.sh
2121source $HESTIA /func/main.sh
22+ source $HESTIA /func/firewall.sh
2223source $HESTIA /conf/hestia.conf
2324
2425
@@ -36,6 +37,9 @@ check_hestia_demo_mode
3637# Action #
3738# ----------------------------------------------------------#
3839
40+ # Self heal iptables links
41+ heal_iptables_links
42+
3943# Creating temporary file
4044tmp=$( mktemp)
4145
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ is_object_valid 'user' 'USER' "$user"
3232is_object_valid ' cron' ' JOB' " $job "
3333is_object_suspended ' cron' ' JOB' " $job "
3434
35+ # Perform verification if read-only mode is enabled
36+ check_hestia_demo_mode
37+
3538
3639# ----------------------------------------------------------#
3740# Action #
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ check_args '1' "$#" 'USER [RESTART]'
2929is_format_valid ' user'
3030is_object_valid ' user' ' USER' " $user "
3131
32+ # Perform verification if read-only mode is enabled
33+ check_hestia_demo_mode
34+
3235
3336# ----------------------------------------------------------#
3437# Action #
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ sysctl="/sbin/sysctl"
2020# Includes
2121source /etc/profile.d/hestia.sh
2222source $HESTIA /func/main.sh
23+ source $HESTIA /func/firewall.sh
2324source $HESTIA /conf/hestia.conf
2425
2526
@@ -34,6 +35,9 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
3435# Action #
3536# ----------------------------------------------------------#
3637
38+ # Self heal iptables links
39+ heal_iptables_links
40+
3741# Checking local IPv4 rules
3842rules=" $HESTIA /data/firewall/rules.conf"
3943
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+ }
Original file line number Diff line number Diff line change 11Source: hestia-php
22Package: hestia-php
33Priority: optional
4- Version: 7.4.12-1
4+ Version: 7.4.12
55Section: admin
66Maintainer: HestaCP <info@hestiacp.com>
77Homepage: https://www.hestiacp.com
You can’t perform that action at this time.
0 commit comments