File tree Expand file tree Collapse file tree 4 files changed +32
-11
lines changed
Expand file tree Collapse file tree 4 files changed +32
-11
lines changed Original file line number Diff line number Diff line change 5858fi
5959
6060# Sync current zones
61- $BIN /v-sync-dns-cluster
61+ $BIN /v-sync-dns-cluster $host
6262return_code=$?
6363if [ " $return_code " -ne 0 ]; then
6464 exit $return_code
6565fi
6666
67+ # Add cron job
68+ cmd=" sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster"
69+ check_cron=$( grep " $cmd " $VESTA /data/users/admin/cron.conf 2> /dev/null)
70+ if [ -z " $check_cron " ] && [ ! -z " $CRON_SYSTEM " ]; then
71+ $BIN /v-add-cron-job admin ' */5' ' *' ' *' ' *' ' *' " $cmd "
72+ fi
73+
74+
6775# ----------------------------------------------------------#
6876# Vesta #
6977# ----------------------------------------------------------#
Original file line number Diff line number Diff line change @@ -37,11 +37,19 @@ $BIN/v-delete-remote-dns-domains $host >>/dev/null 2>&1
3737# Deleting server
3838sed -i " /HOST='$host ' /d" $VESTA /conf/dns-cluster.conf
3939
40- # Disabling DNS_CLUSTER
40+ # Delete DNS_CLUSTER key
4141check_cluster=$( grep HOST $VESTA /conf/dns-cluster.conf | wc -l)
4242if [ " $check_cluster " -eq ' 0' ]; then
4343 rm -f $VESTA /conf/dns-cluster.conf
4444 sed -i " /DNS_CLUSTER=/d" $VESTA /conf/vesta.conf
45+
46+ # Delete cron job
47+ cmd=" sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster"
48+ check_cron=$( grep " $cmd " $VESTA /data/users/admin/cron.conf 2> /dev/null)
49+ if [ ! -z " $check_cron " ]; then
50+ eval $check_cron
51+ $BIN /v-delete-cron-job admin " $JOB "
52+ fi
4553fi
4654
4755
Original file line number Diff line number Diff line change 11#! /bin/bash
22# info: synchronize dns domains
3- #
3+ # options: HOST
44# The function synchronize all dns domains.
55
66
99# ----------------------------------------------------------#
1010
1111# Argument defenition
12- verbose=$1
12+ host=$1
13+ verbose=$2
1314
1415# Includes
1516source $VESTA /conf/vesta.conf
4445old_ifs=" $IFS "
4546IFS=$' \n '
4647
48+ if [ -z $host ]; then
49+ hosts=$( cat $VESTA /conf/dns-cluster.conf)
50+ rm -f $VESTA /data/queue/dns-cluster.pipe
51+ touch $VESTA /data/queue/dns-cluster.pipe
52+ chmod 660 $VESTA /data/queue/dns-cluster.pipe
53+ else
54+ hosts=$( grep " HOST='$host '" $VESTA /conf/dns-cluster.conf)
55+ fi
56+
4757# Starting cluster loop
48- for cluster_str in $( cat $VESTA /conf/dns-cluster.conf ) ; do
58+ for cluster_str in $hosts ; do
4959
5060 # Get host values
5161 eval $cluster_str
@@ -108,11 +118,6 @@ for cluster_str in $(cat $VESTA/conf/dns-cluster.conf); do
108118 exit $E_CONNECT
109119 fi
110120
111- # Clean queue
112- rm -f $VESTA /data/queue/dns-cluster.pipe
113- touch $VESTA /data/queue/dns-cluster.pipe
114- chmod 660 $VESTA /data/queue/dns-cluster.pipe
115-
116121 # Start user loop
117122 for user in $user_list ; do
118123
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ case $queue in
5353 backup) bash $VESTA /data/queue/$queue .pipe > /dev/null 2>&1 ;;
5454 disk) bash $VESTA /data/queue/$queue .pipe ;;
5555 traffic) bash $VESTA /data/queue/$queue .pipe ;;
56- dns-cluster) bash $VESTA /data/queue/$queue .pipe ;;
56+ dns-cluster) bash $VESTA /data/queue/$queue .pipe > /dev/null 2>&1 ;;
5757 * ) check_args ' 1' ' 0' ' QUEUE' ;;
5858esac
5959
You can’t perform that action at this time.
0 commit comments