Skip to content

Commit 21ed4f9

Browse files
authored
Merge pull request hestiacp#1967 from clarkchentw/patch-3
Check firewall enabled before restart iptables
2 parents e6cecb3 + 63ccd37 commit 21ed4f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/v-change-sys-port

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ else
7777
sed -i "/COMMENT='HESTIA'/c\RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='$PORT' IP='0.0.0.0/0' COMMENT='HESTIA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'" $HESTIA/data/firewall/rules.conf
7878

7979
# Restart services
80-
$HESTIA/bin/v-restart-service iptables
80+
if [ -n "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != no ]; then
81+
$HESTIA/bin/v-restart-service iptables
82+
fi
8183

8284
# Check if Hestia is running
8385
if [[ $(ps -eaf | grep -i hestia |sed '/^$/d' | wc -l) > 1 ]]; then

0 commit comments

Comments
 (0)