v_delete_web_domain_cgi 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # info: deliting cgi for domain
  3. #----------------------------------------------------------#
  4. # Variable&Function #
  5. #----------------------------------------------------------#
  6. # Argument defenition
  7. user=$1
  8. domain=$(idn -t --quiet -u "$2" )
  9. domain_idn=$(idn -t --quiet -a "$domain")
  10. # Importing variables
  11. source $VESTA/conf/vars.conf
  12. source $V_CONF/vesta.conf
  13. source $V_FUNC/shared.func
  14. source $V_FUNC/domain.func
  15. #----------------------------------------------------------#
  16. # Verifications #
  17. #----------------------------------------------------------#
  18. # Checking arg number
  19. check_args '2' "$#" 'user domain'
  20. # Checking argument format
  21. format_validation 'user' 'domain'
  22. # Checking web system is enabled
  23. is_system_enabled 'web'
  24. # Checking user
  25. is_user_valid
  26. # Checking user is active
  27. is_user_suspended
  28. # Checking domain exist
  29. is_web_domain_valid
  30. # Checking domain is not suspened
  31. is_domain_suspended 'web'
  32. # Checking cgi is added
  33. is_web_domain_value_exist '$CGI'
  34. #----------------------------------------------------------#
  35. # Action #
  36. #----------------------------------------------------------#
  37. get_web_domain_values
  38. tpl_file="$V_WEBTPL/apache_$TPL.tpl"
  39. conf="$V_HOME/$user/conf/httpd.conf"
  40. CGI='no'
  41. # Preparing domain values for the template substitution
  42. upd_web_domain_values
  43. # Recreating vhost
  44. del_web_config
  45. add_web_config
  46. # Checking ssl
  47. if [ "$SSL" = 'yes' ]; then
  48. tpl_file="$V_WEBTPL/apache_$TPL.stpl"
  49. conf="$V_HOME/$user/conf/shttpd.conf"
  50. del_web_config
  51. add_web_config
  52. fi
  53. #----------------------------------------------------------#
  54. # Vesta #
  55. #----------------------------------------------------------#
  56. # Deleting cgi in config
  57. update_web_domain_value '$CGI' 'no'
  58. # Adding task to the vesta pipe
  59. restart_schedule 'web'
  60. # Logging
  61. log_history "$V_EVENT" "v_add_web_domain_cgi $user $domain"
  62. log_event 'system' "$V_EVENT"
  63. exit