v_list_web_domains_stats 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # Importing variables
  16. source $VESTA/conf/vars.conf
  17. source $V_FUNC/shared.func
  18. #----------------------------------------------------------#
  19. # Verifications #
  20. #----------------------------------------------------------#
  21. # Checking args
  22. check_args '1' "$#" 'user [format]'
  23. # Checking argument format
  24. format_validation 'user'
  25. # Checking user
  26. is_user_valid
  27. #----------------------------------------------------------#
  28. # Action #
  29. #----------------------------------------------------------#
  30. # Defining config
  31. conf=$V_USERS/$user/web.conf
  32. # Defining fileds to select
  33. fields="\$DOMAIN \$STATS \$STATS_AUTH"
  34. # Listing domains
  35. case $format in
  36. json) json_list ;;
  37. plain) nohead=1; shell_list ;;
  38. shell) shell_list | column -t ;;
  39. *) check_args '1' "0" 'user [format]'
  40. esac
  41. #----------------------------------------------------------#
  42. # Vesta #
  43. #----------------------------------------------------------#
  44. exit