v_list_web_domains_nginx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. # info: list web domains and nginx key
  3. # options: user [format]
  4. #
  5. # The function for obtaining the list of domains with nginx parameter
  6. # displayed. This call was arranged for filling in the lack of information by
  7. # applying v_list_web_domains call in the shell format.
  8. #----------------------------------------------------------#
  9. # Variable&Function #
  10. #----------------------------------------------------------#
  11. # Argument defenition
  12. user=$1
  13. format=${2-shell}
  14. # Importing variables
  15. source $VESTA/conf/vars.conf
  16. source $V_FUNC/shared.func
  17. #----------------------------------------------------------#
  18. # Verifications #
  19. #----------------------------------------------------------#
  20. # Checking args
  21. check_args '1' "$#" 'user [format]'
  22. # Checking argument format
  23. format_validation 'user'
  24. # Checking user
  25. is_user_valid
  26. #----------------------------------------------------------#
  27. # Action #
  28. #----------------------------------------------------------#
  29. # Defining config
  30. conf=$V_USERS/$user/web.conf
  31. # Defining fileds to select
  32. fields="\$DOMAIN \$NGINX \$NGINX_EXT"
  33. # Listing domains
  34. case $format in
  35. json) json_list ;;
  36. plain) nohead=1; shell_list ;;
  37. shell) shell_list | column -t ;;
  38. *) check_args '1' '0' 'user [format]'
  39. esac
  40. #----------------------------------------------------------#
  41. # Vesta #
  42. #----------------------------------------------------------#
  43. exit