Răsfoiți Sursa

Check firewall enabled before restart iptables

This error was found during apt package upgrade
`Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up hestia-nginx (1.19.10) ...
Error: FIREWALL_SYSTEM is not enabled
Error: ERROR: Restart of iptables failed.`
Clark Chen 4 ani în urmă
părinte
comite
63ccd37d35
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      bin/v-change-sys-port

+ 3 - 1
bin/v-change-sys-port

@@ -77,7 +77,9 @@ else
     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
     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
     
     
     # Restart services
     # Restart services
-    $HESTIA/bin/v-restart-service iptables
+    if [ -n "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != no ]; then
+        $HESTIA/bin/v-restart-service iptables
+    fi
 
 
     # Check if Hestia is running
     # Check if Hestia is running
     if [[ $(ps -eaf | grep -i hestia |sed '/^$/d' | wc -l) > 1 ]]; then
     if [[ $(ps -eaf | grep -i hestia |sed '/^$/d' | wc -l) > 1 ]]; then