v-update-web-domains-stat 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # info: update domains statistics
  3. # options: user
  4. #
  5. # The function runs log analyzer usage for all user webdomains.
  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'
  19. validate_format 'user'
  20. is_system_enabled "$WEB_SYSTEM"
  21. is_object_valid 'user' 'USER' "$user"
  22. is_object_unsuspended 'user' 'USER' "$user"
  23. #----------------------------------------------------------#
  24. # Action #
  25. #----------------------------------------------------------#
  26. # Starting upd loop
  27. for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
  28. get_domain_values 'web'
  29. if [ ! -z "$STATS" ] && [ "$STATS" != 'no' ]; then
  30. $BIN/v-update-web-domain-stat "$user" "$domain"
  31. fi
  32. done
  33. #----------------------------------------------------------#
  34. # Vesta #
  35. #----------------------------------------------------------#
  36. # Logging
  37. log_event "$OK" "$EVENT"
  38. exit