v-delete-sys-firewall 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. # info: delete system firewall
  3. # options: NONE
  4. # labels: panel
  5. #
  6. # example: v-delete-sys-firewall
  7. #
  8. # The script disables firewall support
  9. #----------------------------------------------------------#
  10. # Variable&Function #
  11. #----------------------------------------------------------#
  12. # Includes
  13. source $HESTIA/func/main.sh
  14. source $HESTIA/conf/hestia.conf
  15. #----------------------------------------------------------#
  16. # Verifications #
  17. #----------------------------------------------------------#
  18. if [ -z "$FIREWALL_SYSTEM" ]; then
  19. exit
  20. fi
  21. # Perform verification if read-only mode is enabled
  22. check_hestia_demo_mode
  23. #----------------------------------------------------------#
  24. # Action #
  25. #----------------------------------------------------------#
  26. # Stopping firewall
  27. $BIN/v-stop-firewall
  28. # Updating FIREWALL_SYSTEM value
  29. if [ -z "$(grep FIREWALL_SYSTEM $HESTIA/conf/hestia.conf)" ]; then
  30. echo "FIREWALL_SYSTEM=''" >> $HESTIA/conf/hestia.conf
  31. else
  32. sed -i "s/FIREWALL_SYSTEM=.*/FIREWALL_SYSTEM=''/g" $HESTIA/conf/hestia.conf
  33. fi
  34. #----------------------------------------------------------#
  35. # Hestia #
  36. #----------------------------------------------------------#
  37. # Logging
  38. log_event "$OK" "$ARGUMENTS"
  39. exit