v_get_sys_user_value 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_CONF/vesta.conf
  12. source $V_FUNC/shared.func
  13. #----------------------------------------------------------#
  14. # Verifications #
  15. #----------------------------------------------------------#
  16. # Checking args
  17. check_args '2' "$#" 'user key'
  18. # Checking argument format
  19. format_validation 'user'
  20. # Checking user
  21. is_user_valid
  22. # Checking domain is not suspened
  23. is_user_suspended
  24. #----------------------------------------------------------#
  25. # Action #
  26. #----------------------------------------------------------#
  27. # Checking key
  28. value=$(get_user_value "$key")
  29. # Printing value
  30. echo "$value"
  31. #----------------------------------------------------------#
  32. # Vesta #
  33. #----------------------------------------------------------#
  34. # Logging
  35. log_event 'system' "$V_EVENT"
  36. exit