From 742dfbec285b03ee778548eb4c28e234ecae16f8 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 21 Sep 2011 12:42:13 +0300 Subject: [PATCH] dns template listing --- bin/v_list_dns_template | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 bin/v_list_dns_template diff --git a/bin/v_list_dns_template b/bin/v_list_dns_template new file mode 100755 index 000000000..50514a66b --- /dev/null +++ b/bin/v_list_dns_template @@ -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