vesta/bin/v_list_sys_user_ns
2011-06-14 00:22:25 +03:00

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