Skip to content

Commit 79edadb

Browse files
authored
Fixes iptables appearing stopped when fail2ban is stopped (hestiacp#1374)
1 parent c02f5e6 commit 79edadb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bin/v-list-sys-services

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,11 @@ fi
284284
# Checking FIREWALL system
285285
if [ ! -z "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != 'remote' ]; then
286286
state="stopped"
287-
/sbin/iptables -n -L fail2ban-HESTIA >/dev/null 2>&1
288-
if [ "$?" -eq 0 ]; then
287+
if $(iptables -S INPUT | grep -qx '\-P INPUT DROP'); then
289288
state="running"
290289
fi
291290
data="$data\nNAME='$FIREWALL_SYSTEM' SYSTEM='firewall'"
292-
data="$data STATE='$state' CPU='0' MEM='0' RTIME='$rtime'"
291+
data="$data STATE='$state' CPU='0' MEM='0' RTIME='0'"
293292
fi
294293

295294

0 commit comments

Comments
 (0)