mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-01-08 20:13:01 -08:00
53 lines
1.6 KiB
Bash
Executable File
53 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: listing system users
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument defenition
|
|
format="${1-shell}"
|
|
limit="${2-1000}"
|
|
offset="${3-1}"
|
|
|
|
# Importing variables
|
|
source $VESTA/conf/vars.conf
|
|
source $V_FUNC/shared_func.sh
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
# Checking argument format
|
|
format_validation 'limit' 'offset'
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# 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 $WEB_TPL $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 domains
|
|
case $format in
|
|
json) usr_json_list ;;
|
|
shell) fields='$USER $PACKAGE $U_DISK $U_BANDWIDTH $SUSPENDED $DATE';
|
|
usr_shell_list | column -t ;;
|
|
*) check_args '1' '0' '[format] [limit] [offset]'
|
|
esac
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event 'system' "$V_EVENT"
|
|
|
|
exit $OK
|