mirror of
https://github.com/serghey-rodin/vesta.git
synced 2026-03-11 06:30:35 +01:00
58 lines
1.3 KiB
Bash
Executable File
58 lines
1.3 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/^/$/")
|
|
|
|
# Importing variables
|
|
source $VESTA/conf/vars.conf
|
|
source $V_CONF/vesta.conf
|
|
source $V_FUNC/shared.func
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
# Checking args
|
|
check_args '2' "$#" 'user key'
|
|
|
|
# Checking argument format
|
|
format_validation 'user'
|
|
|
|
# Checking user
|
|
is_user_valid
|
|
|
|
# Checking domain is not suspened
|
|
is_user_suspended
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Checking key
|
|
value=$(get_user_value "$key")
|
|
|
|
# Printing value
|
|
echo "$value"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event 'system' "$V_EVENT"
|
|
|
|
exit
|