v_get_dns_domain_value 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. # info: get dns domain value
  3. # options: user domain key
  4. #
  5. # The function for getting a certain DNS domain parameter.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument defenition
  10. user=$1
  11. domain=$(idn -t --quiet -u "$2" )
  12. domain_idn=$(idn -t --quiet -a "$domain")
  13. key=$(echo "$3"| tr '[:lower:]' '[:upper:]'|sed -e "s/^/$/")
  14. # Importing variables
  15. source $VESTA/conf/vars.conf
  16. source $V_CONF/vesta.conf
  17. source $V_FUNC/shared.func
  18. source $V_FUNC/domain.func
  19. #----------------------------------------------------------#
  20. # Verifications #
  21. #----------------------------------------------------------#
  22. # Checking args
  23. check_args '3' "$#" 'user domain key'
  24. # Checking argument format
  25. format_validation 'user' 'domain'
  26. # Checking user
  27. is_user_valid
  28. # Checking domain exist
  29. is_dns_domain_valid
  30. # Checking domain is not suspened
  31. is_domain_suspended 'dns'
  32. #----------------------------------------------------------#
  33. # Action #
  34. #----------------------------------------------------------#
  35. # Checking key
  36. value=$(get_dns_domain_value "$key")
  37. # Printing value
  38. echo "$value"
  39. #----------------------------------------------------------#
  40. # Vesta #
  41. #----------------------------------------------------------#
  42. # Logging
  43. log_event 'system' "$V_EVENT"
  44. exit