v_get_web_domain_value 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. # info: Getting web 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 user is active
  24. is_user_suspended
  25. # Checking domain exist
  26. is_web_domain_valid
  27. # Checking domain is not suspened
  28. is_domain_suspended 'web_domains'
  29. #----------------------------------------------------------#
  30. # Action #
  31. #----------------------------------------------------------#
  32. # Checking key
  33. value=$(get_web_domain_value "$key")
  34. # Printing value
  35. echo "$value"
  36. #----------------------------------------------------------#
  37. # Vesta #
  38. #----------------------------------------------------------#
  39. # Logging
  40. log_event 'system' "$V_EVENT"
  41. exit $OK