v_get_dns_domain_value 1.4 KB

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