v_suspend_web_domains 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # info: suspend web domains
  3. # options: user
  4. #
  5. # The function of suspending all user's sites.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument defenition
  10. user=$1
  11. # Importing variables
  12. source $VESTA/conf/vars.conf
  13. source $V_CONF/vesta.conf
  14. source $V_FUNC/shared.func
  15. source $V_FUNC/domain.func
  16. # Defining url
  17. url="${2-$V_SUSPEND_URL}"
  18. #----------------------------------------------------------#
  19. # Verifications #
  20. #----------------------------------------------------------#
  21. # Checking arg number
  22. check_args '1' "$#" 'user [suspend_url]'
  23. # Checking argument format
  24. format_validation 'user' 'url'
  25. # Checking web system is enabled
  26. is_system_enabled 'web'
  27. # Checking user
  28. is_user_valid
  29. #----------------------------------------------------------#
  30. # Action #
  31. #----------------------------------------------------------#
  32. # Defining config
  33. conf="$V_USERS/$user/web.conf"
  34. # Defining fileds to select
  35. field='$DOMAIN'
  36. search_string="SUSPEND='no'"
  37. domains=$(dom_clear_search)
  38. # Starting suspend loop
  39. for domain in $domains; do
  40. $V_BIN/v_suspend_web_domain "$user" "$domain" "$url"
  41. done
  42. #----------------------------------------------------------#
  43. # Vesta #
  44. #----------------------------------------------------------#
  45. # Logging
  46. log_event 'system' "$V_EVENT"
  47. exit