mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
dns template listing
This commit is contained in:
parent
472494b82c
commit
742dfbec28
1 changed files with 59 additions and 0 deletions
59
bin/v_list_dns_template
Executable file
59
bin/v_list_dns_template
Executable file
|
@ -0,0 +1,59 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# info: listing dns template
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Variable&Function #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Argument defenition
|
||||||
|
template="$1"
|
||||||
|
format="${2-shell}"
|
||||||
|
limit="${3-1000}"
|
||||||
|
offset="${4-1}"
|
||||||
|
|
||||||
|
# Importing variables
|
||||||
|
source $VESTA/conf/vars.conf
|
||||||
|
source $V_FUNC/shared_func.sh
|
||||||
|
source $V_FUNC/domain_func.sh
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Verifications #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Checking args
|
||||||
|
check_args '1' "$#" 'template [format]'
|
||||||
|
|
||||||
|
# Checking argument format
|
||||||
|
format_validation 'template'
|
||||||
|
|
||||||
|
# Checking template
|
||||||
|
is_template_valid 'dns'
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Action #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Defining config
|
||||||
|
conf="$V_DNSTPL/$template.tpl"
|
||||||
|
|
||||||
|
# Defining fileds to select
|
||||||
|
fields='$RECORD $TYPE $VALUE'
|
||||||
|
|
||||||
|
# Listing domains
|
||||||
|
case $format in
|
||||||
|
json) dns_json_list ;;
|
||||||
|
shell) dns_shell_list | column -t ;;
|
||||||
|
*) check_args '1' "0" 'template [format]'
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Vesta #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
log_event 'system' "$V_EVENT"
|
||||||
|
|
||||||
|
exit $OK
|
Loading…
Add table
Add a link
Reference in a new issue