mirror of
https://github.com/serghey-rodin/vesta.git
synced 2026-03-21 03:11:54 +01:00
61 lines
1.7 KiB
Bash
Executable File
61 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: listing system user
|
|
|
|
#----------------------------------------------------------#
|
|
# 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 #
|
|
#----------------------------------------------------------#
|
|
|
|
# Defining config
|
|
conf="$V_USERS/$user/user.conf"
|
|
|
|
# Defining fileds to select
|
|
fields='$USER $PACKAGE $WEB_DOMAINS $WEB_SSL $WEB_ALIASES $DATABASES
|
|
$MAIL_DOMAINS $MAIL_BOXES $MAIL_FORWARDERS $DNS_DOMAINS $DISK_QUOTA
|
|
$BANDWIDTH $NS1 $NS2 $SHELL $BACKUPS $TEMPLATES $MAX_CHILDS $SUSPENDED
|
|
$OWNER $ROLE $IP_OWNED $U_CHILDS $U_DISK $U_BANDWIDTH $U_WEB_DOMAINS
|
|
$U_WEB_SSL $U_DNS_DOMAINS $U_DATABASES $U_MAIL_DOMAINS $CONTACT $DATE'
|
|
|
|
# Listing user
|
|
case $format in
|
|
json) usr_json_single_list ;;
|
|
shell) usr_shell_single_list | column -t ;;
|
|
*) check_args '1' "0" 'user [format]'
|
|
esac
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event 'system' "$V_EVENT"
|
|
|
|
exit $OK
|