myvesta/bin/v-get-user-value
2016-06-09 16:55:35 +03:00

45 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# info: get user value
# options: USER KEY
#
# The function for obtaining certain user's parameters.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
user=$1
key=$(echo "$2"| tr '[:lower:]' '[:upper:]' | sed "s/^/$/")
# Includes
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER KEY'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Checking key
value=$(get_user_value "$key")
# Printing value
echo "$value"
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit