v-get-web-domain-value 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. # Say goodbye
  12. echo "This script is not used anymore"
  13. exit
  14. # Argument definition
  15. user=$1
  16. domain=$(idn -t --quiet -u "$2" )
  17. domain_idn=$(idn -t --quiet -a "$domain")
  18. key=$(echo "$3"| tr '[:lower:]' '[:upper:]' | sed "s/^/$/")
  19. # Includes
  20. source $VESTA/func/main.sh
  21. source $VESTA/func/domain.sh
  22. source $VESTA/conf/vesta.conf
  23. #----------------------------------------------------------#
  24. # Verifications #
  25. #----------------------------------------------------------#
  26. check_args '3' "$#" 'USER DOMAIN KEY'
  27. is_format_valid 'user' 'domain'
  28. is_object_valid 'user' 'USER' "$user"
  29. is_object_unsuspended 'user' 'USER' "$user"
  30. is_object_valid 'web' 'DOMAIN' "$domain"
  31. #----------------------------------------------------------#
  32. # Action #
  33. #----------------------------------------------------------#
  34. get_domain_values 'web'
  35. eval echo $key
  36. #----------------------------------------------------------#
  37. # Vesta #
  38. #----------------------------------------------------------#
  39. exit