mirror of
https://github.com/myvesta/vesta.git
synced 2025-01-12 05:52:53 -08:00
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: get mail domain value
|
|
# options: USER DOMAIN KEY
|
|
#
|
|
# The function for getting a certain mail domain parameter.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
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
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
check_args '3' "$#" 'USER DOMAIN KEY'
|
|
is_format_valid 'user' 'domain'
|
|
is_object_valid 'user' 'USER' "$user"
|
|
is_object_valid 'mail' 'DOMAIN' "$domain"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Print
|
|
get_object_value 'mail' 'DOMAIN' "$domain" "$key"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event "$OK" "$ARGUMENTS"
|
|
|
|
exit
|