v_get_web_domain_value 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. # info: Getting web 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_FUNC/shared_func.sh
  14. source $V_FUNC/domain_func.sh
  15. #----------------------------------------------------------#
  16. # Verifications #
  17. #----------------------------------------------------------#
  18. # Checking args
  19. check_args '3' "$#" 'user domain key'
  20. # Checking argument format
  21. format_validation 'user' 'domain'
  22. # Checking user
  23. is_user_valid
  24. # Checking user is active
  25. is_user_suspended
  26. # Checking domain exist
  27. is_web_domain_valid
  28. # Checking domain is not suspened
  29. is_domain_suspended 'web_domains'
  30. #----------------------------------------------------------#
  31. # Action #
  32. #----------------------------------------------------------#
  33. # Checking key
  34. value=$(get_web_domain_value "$key")
  35. # Printing value
  36. echo "$value"
  37. #----------------------------------------------------------#
  38. # Vesta #
  39. #----------------------------------------------------------#
  40. # Logging
  41. log_event 'system' "$V_EVENT"
  42. exit $OK