v-delete-web-domain-ssl-force 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. # info: remove ssl force from domain
  3. # options: USER DOMAIN [RESTART]
  4. #
  5. # The function removes force SSL configurations.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  10. user=$1
  11. domain=$2
  12. restart=$3
  13. # Includes
  14. source $HESTIA/func/main.sh
  15. #----------------------------------------------------------#
  16. # Verifications #
  17. #----------------------------------------------------------#
  18. check_args '2' "$#" 'USER DOMAIN'
  19. is_format_valid 'user' 'domain' 'ssl_dir'
  20. is_object_valid 'user' 'USER' "$user"
  21. is_object_unsuspended 'user' 'USER' "$user"
  22. is_object_valid 'web' 'DOMAIN' "$domain"
  23. is_object_unsuspended 'web' 'DOMAIN' "$domain"
  24. #----------------------------------------------------------#
  25. # Action #
  26. #----------------------------------------------------------#
  27. # Load domain data
  28. eval $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
  29. # Remove forcessl configs
  30. rm -f /home/$user/conf/web/forcessl.*$domain*.conf
  31. #----------------------------------------------------------#
  32. # Hestia #
  33. #----------------------------------------------------------#
  34. # Restart services if requested
  35. if [ ! -z "$restart" ]; then
  36. $BIN/v-restart-web
  37. check_result $? "Web restart failed" >/dev/null
  38. $BIN/v-restart-proxy
  39. check_result $? "Proxy restart failed" >/dev/null
  40. fi
  41. exit