forked from outroll/vesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv-get-web-domain-value
executable file
·49 lines (36 loc) · 1.48 KB
/
v-get-web-domain-value
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
46
47
48
49
#!/bin/bash
# info: get web domain value
# options: USER DOMAIN KEY
#
# The function is intended for obtaining a domain value by the key. This call
# is useful for arranging composite queries. The answer is displayed only in
# raw form; output formats aren't supported.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
key=$(echo "$3"| tr '[:lower:]' '[:upper:]' | sed "s/^/$/")
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'USER DOMAIN KEY'
validate_format 'user' 'domain'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
get_domain_values 'web'
eval echo $key
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit