v_list_web_domains_stats 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # info: list web domains and stats key
  3. # options: user [format]
  4. #
  5. # The function for obtaining the list of domains with statistics parameter
  6. # displayed, including authentication settings. This call was arranged for
  7. # filling in the lack of information by applying v_list_web_domains call in
  8. # the shell format.
  9. #----------------------------------------------------------#
  10. # Variable&Function #
  11. #----------------------------------------------------------#
  12. # Argument defenition
  13. user=$1
  14. format=${2-shell}
  15. # Includes
  16. source $VESTA/func/main.sh
  17. #----------------------------------------------------------#
  18. # Verifications #
  19. #----------------------------------------------------------#
  20. check_args '1' "$#" 'user [format]'
  21. validate_format 'user'
  22. is_object_valid 'user' 'USER' "$user"
  23. #----------------------------------------------------------#
  24. # Action #
  25. #----------------------------------------------------------#
  26. # Defining config
  27. conf=$USER_DATA/web.conf
  28. # Defining fileds to select
  29. fields="\$DOMAIN \$STATS \$STATS_AUTH \$SUSPENDED \$TIME \$DATE"
  30. # Listing domains
  31. case $format in
  32. json) json_list ;;
  33. plain) nohead=1; shell_list ;;
  34. shell) shell_list | column -t ;;
  35. *) check_args '1' "0" 'user [format]'
  36. esac
  37. #----------------------------------------------------------#
  38. # Vesta #
  39. #----------------------------------------------------------#
  40. exit