v_get_web_domain_value 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_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 user is active
  26. is_user_suspended
  27. # Checking domain exist
  28. is_web_domain_valid
  29. # Checking domain is not suspened
  30. is_domain_suspended 'web'
  31. #----------------------------------------------------------#
  32. # Action #
  33. #----------------------------------------------------------#
  34. value=$(get_web_domain_value "$key")
  35. echo "$value"
  36. #----------------------------------------------------------#
  37. # Vesta #
  38. #----------------------------------------------------------#
  39. exit