mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 04:51:54 -07:00
45 lines
1.2 KiB
Bash
Executable file
45 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
# info: get user value
|
|
# options: user key
|
|
#
|
|
# The function for obtaining certain user's parameters.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument defenition
|
|
user=$1
|
|
key=$(echo "$2"| tr '[:lower:]' '[:upper:]'|sed -e "s/^/$/")
|
|
|
|
# Includes
|
|
source $VESTA/conf/vesta.conf
|
|
source $VESTA/func/main.sh
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
check_args '2' "$#" 'user key'
|
|
validate_format 'user'
|
|
is_object_valid 'user' 'USER' "$user"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Checking key
|
|
value=$(get_user_value "$key")
|
|
|
|
# Printing value
|
|
echo "$value"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
exit
|