v_get_web_domain_value 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. # info: get web domain value
  3. # options: user domain key
  4. #
  5. # The function is intended for obtaining a domain value by the key. This call
  6. # is useful for arranging composite queries. The answer is displayed only in
  7. # raw form; output formats aren't supported.
  8. #----------------------------------------------------------#
  9. # Variable&Function #
  10. #----------------------------------------------------------#
  11. # Argument defenition
  12. user=$1
  13. domain=$(idn -t --quiet -u "$2" )
  14. domain_idn=$(idn -t --quiet -a "$domain")
  15. key=$(echo "$3"| tr '[:lower:]' '[:upper:]'|sed -e "s/^/$/")
  16. # Importing variables
  17. source $VESTA/conf/vars.conf
  18. source $V_CONF/vesta.conf
  19. source $V_FUNC/shared.func
  20. source $V_FUNC/domain.func
  21. #----------------------------------------------------------#
  22. # Verifications #
  23. #----------------------------------------------------------#
  24. # Checking args
  25. check_args '3' "$#" 'user domain key'
  26. # Checking argument format
  27. format_validation 'user' 'domain'
  28. # Checking user
  29. is_user_valid
  30. # Checking user is active
  31. is_user_suspended
  32. # Checking domain exist
  33. is_web_domain_valid
  34. # Checking domain is not suspened
  35. is_domain_suspended 'web'
  36. #----------------------------------------------------------#
  37. # Action #
  38. #----------------------------------------------------------#
  39. value=$(get_web_domain_value "$key")
  40. echo "$value"
  41. #----------------------------------------------------------#
  42. # Vesta #
  43. #----------------------------------------------------------#
  44. exit