Przeglądaj źródła

dns template listing

Serghey Rodin 14 lat temu
rodzic
commit
742dfbec28
1 zmienionych plików z 59 dodań i 0 usunięć
  1. 59 0
      bin/v_list_dns_template

+ 59 - 0
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