v_suspend_web_domains 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. # Includes
  12. source $VESTA/conf/vesta.conf
  13. source $VESTA/func/main.sh
  14. source $VESTA/func/domain.sh
  15. #----------------------------------------------------------#
  16. # Verifications #
  17. #----------------------------------------------------------#
  18. check_args '1' "$#" 'user [suspend_url]'
  19. validate_format 'user' 'url'
  20. is_system_enabled "$WEB_SYSTEM"
  21. is_object_valid 'user' 'USER' "$user"
  22. #----------------------------------------------------------#
  23. # Action #
  24. #----------------------------------------------------------#
  25. # Starting suspend loop
  26. for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
  27. $BIN/v_suspend_web_domain "$user" "$domain" "$url" 'no'
  28. done
  29. #----------------------------------------------------------#
  30. # Vesta #
  31. #----------------------------------------------------------#
  32. # Restart web server
  33. $BIN/v_restart_web "$EVENT"
  34. # Logging
  35. log_event "$OK" "$EVENT"
  36. exit