v_get_dns_domain_value 1.4 KB

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