mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-01-08 20:13:01 -08:00
51 lines
1.2 KiB
Bash
Executable File
51 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: listing user nameservers
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument defenition
|
|
user="$1"
|
|
format="${2-shell}"
|
|
|
|
# Importing variables
|
|
source $VESTA/conf/vars.conf
|
|
source $V_FUNC/shared_func.sh
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
# Checking args
|
|
check_args '1' "$#" 'user [format]'
|
|
|
|
# Checking argument format
|
|
format_validation 'user'
|
|
|
|
# Checking user
|
|
is_user_valid
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Listing nameservers
|
|
case $format in
|
|
json) usrns_json_list ;;
|
|
shell) usrns_shell_list ;;
|
|
*) check_args '1' '0' 'user [format]'
|
|
esac
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event 'system' "$V_EVENT"
|
|
|
|
exit $OK
|