forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv-get-user-value
More file actions
executable file
·45 lines (31 loc) · 1.16 KB
/
v-get-user-value
File metadata and controls
executable file
·45 lines (31 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/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