Преглед изворни кода

suspend/unsuspend remote dns hosts

Serghey Rodin пре 12 година
родитељ
комит
f357610bc7
2 измењених фајлова са 92 додато и 0 уклоњено
  1. 46 0
      bin/v-suspend-remote-dns-host
  2. 46 0
      bin/v-unsuspend-remote-dns-host

+ 46 - 0
bin/v-suspend-remote-dns-host

@@ -0,0 +1,46 @@
+#!/bin/bash
+# info: suspend remote dns server
+# options: HOST
+#
+# The function for suspending remote dns server.
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
+
+# Argument defenition
+host=$1
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+
+#----------------------------------------------------------#
+#                    Verifications                         #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'HOST'
+validate_format 'host'
+is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
+is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
+is_object_unsuspended "../../conf/dns-cluster" 'HOST' "$host"
+
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
+
+# Unsuspend remote dns server
+update_object_value "../../conf/dns-cluster" 'HOST' "$host" '$SUSPENDED' 'yes'
+
+
+#----------------------------------------------------------#
+#                       Vesta                              #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$EVENT"
+
+exit

+ 46 - 0
bin/v-unsuspend-remote-dns-host

@@ -0,0 +1,46 @@
+#!/bin/bash
+# info: unsuspend remote dns server
+# options: HOST
+#
+# The function for unsuspending remote dns server.
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
+
+# Argument defenition
+host=$1
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+
+#----------------------------------------------------------#
+#                    Verifications                         #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'HOST'
+validate_format 'host'
+is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
+is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
+is_object_suspended "../../conf/dns-cluster" 'HOST' "$host"
+
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
+
+# Unsuspend remote dns server
+update_object_value "../../conf/dns-cluster" 'HOST' "$host" '$SUSPENDED' 'no'
+
+
+#----------------------------------------------------------#
+#                       Vesta                              #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$EVENT"
+
+exit