mirror of
https://github.com/serghey-rodin/vesta.git
synced 2024-12-03 19:00:24 -08:00
45 lines
1.1 KiB
Bash
Executable File
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
|