v_get_sys_user_value 1.2 KB

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