v_list_web_domains_alias 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. # info: listing web domains
  3. #----------------------------------------------------------#
  4. # Variable&Function #
  5. #----------------------------------------------------------#
  6. # Argument defenition
  7. user=$1
  8. format=${2-shell}
  9. # Importing variables
  10. source $VESTA/conf/vars.conf
  11. source $V_FUNC/shared.func
  12. #----------------------------------------------------------#
  13. # Verifications #
  14. #----------------------------------------------------------#
  15. # Checking args
  16. check_args '1' "$#" 'user [format]'
  17. # Checking argument format
  18. format_validation 'user'
  19. # Checking user
  20. is_user_valid
  21. #----------------------------------------------------------#
  22. # Action #
  23. #----------------------------------------------------------#
  24. # Defining config
  25. conf=$V_USERS/$user/web.conf
  26. # Defining fileds to select
  27. fields="\$DOMAIN \$ALIAS"
  28. # Listing domains
  29. case $format in
  30. json) json_list ;;
  31. plain) nohead=1; shell_list ;;
  32. shell) shell_list | column -t ;;
  33. *) check_args '1' '0' 'user [format]'
  34. esac
  35. #----------------------------------------------------------#
  36. # Vesta #
  37. #----------------------------------------------------------#
  38. exit