v-delete-sys-firewall 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # shellcheck source=/usr/local/hestia/func/main.sh
  14. source $HESTIA/func/main.sh
  15. # shellcheck source=/usr/local/hestia/conf/hestia.conf
  16. source $HESTIA/conf/hestia.conf
  17. #----------------------------------------------------------#
  18. # Verifications #
  19. #----------------------------------------------------------#
  20. if [ -z "$FIREWALL_SYSTEM" ]; then
  21. exit
  22. fi
  23. # Perform verification if read-only mode is enabled
  24. check_hestia_demo_mode
  25. #----------------------------------------------------------#
  26. # Action #
  27. #----------------------------------------------------------#
  28. # Stopping firewall
  29. $BIN/v-stop-firewall
  30. # Updating FIREWALL_SYSTEM value
  31. if [ -z "$(grep FIREWALL_SYSTEM $HESTIA/conf/hestia.conf)" ]; then
  32. echo "FIREWALL_SYSTEM=''" >> $HESTIA/conf/hestia.conf
  33. else
  34. sed -i "s/FIREWALL_SYSTEM=.*/FIREWALL_SYSTEM=''/g" $HESTIA/conf/hestia.conf
  35. fi
  36. #----------------------------------------------------------#
  37. # Hestia #
  38. #----------------------------------------------------------#
  39. # Logging
  40. log_event "$OK" "$ARGUMENTS"
  41. exit