mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 05:14:10 -07:00
added sys-queue handler
This commit is contained in:
parent
7ebd96d92d
commit
22ab6d500c
4 changed files with 32 additions and 11 deletions
|
@ -58,12 +58,20 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sync current zones
|
# Sync current zones
|
||||||
$BIN/v-sync-dns-cluster
|
$BIN/v-sync-dns-cluster $host
|
||||||
return_code=$?
|
return_code=$?
|
||||||
if [ "$return_code" -ne 0 ]; then
|
if [ "$return_code" -ne 0 ]; then
|
||||||
exit $return_code
|
exit $return_code
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Add cron job
|
||||||
|
cmd="sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster"
|
||||||
|
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
|
||||||
|
if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
|
||||||
|
$BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Vesta #
|
# Vesta #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
|
@ -37,11 +37,19 @@ $BIN/v-delete-remote-dns-domains $host >>/dev/null 2>&1
|
||||||
# Deleting server
|
# Deleting server
|
||||||
sed -i "/HOST='$host' /d" $VESTA/conf/dns-cluster.conf
|
sed -i "/HOST='$host' /d" $VESTA/conf/dns-cluster.conf
|
||||||
|
|
||||||
# Disabling DNS_CLUSTER
|
# Delete DNS_CLUSTER key
|
||||||
check_cluster=$(grep HOST $VESTA/conf/dns-cluster.conf |wc -l)
|
check_cluster=$(grep HOST $VESTA/conf/dns-cluster.conf |wc -l)
|
||||||
if [ "$check_cluster" -eq '0' ]; then
|
if [ "$check_cluster" -eq '0' ]; then
|
||||||
rm -f $VESTA/conf/dns-cluster.conf
|
rm -f $VESTA/conf/dns-cluster.conf
|
||||||
sed -i "/DNS_CLUSTER=/d" $VESTA/conf/vesta.conf
|
sed -i "/DNS_CLUSTER=/d" $VESTA/conf/vesta.conf
|
||||||
|
|
||||||
|
# Delete cron job
|
||||||
|
cmd="sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster"
|
||||||
|
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
|
||||||
|
if [ ! -z "$check_cron" ]; then
|
||||||
|
eval $check_cron
|
||||||
|
$BIN/v-delete-cron-job admin "$JOB"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: synchronize dns domains
|
# info: synchronize dns domains
|
||||||
#
|
# options: HOST
|
||||||
# The function synchronize all dns domains.
|
# The function synchronize all dns domains.
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Argument defenition
|
# Argument defenition
|
||||||
verbose=$1
|
host=$1
|
||||||
|
verbose=$2
|
||||||
|
|
||||||
# Includes
|
# Includes
|
||||||
source $VESTA/conf/vesta.conf
|
source $VESTA/conf/vesta.conf
|
||||||
|
@ -44,8 +45,17 @@ fi
|
||||||
old_ifs="$IFS"
|
old_ifs="$IFS"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|
||||||
|
if [ -z $host ]; then
|
||||||
|
hosts=$(cat $VESTA/conf/dns-cluster.conf)
|
||||||
|
rm -f $VESTA/data/queue/dns-cluster.pipe
|
||||||
|
touch $VESTA/data/queue/dns-cluster.pipe
|
||||||
|
chmod 660 $VESTA/data/queue/dns-cluster.pipe
|
||||||
|
else
|
||||||
|
hosts=$(grep "HOST='$host'" $VESTA/conf/dns-cluster.conf)
|
||||||
|
fi
|
||||||
|
|
||||||
# Starting cluster loop
|
# Starting cluster loop
|
||||||
for cluster_str in $(cat $VESTA/conf/dns-cluster.conf); do
|
for cluster_str in $hosts; do
|
||||||
|
|
||||||
# Get host values
|
# Get host values
|
||||||
eval $cluster_str
|
eval $cluster_str
|
||||||
|
@ -108,11 +118,6 @@ for cluster_str in $(cat $VESTA/conf/dns-cluster.conf); do
|
||||||
exit $E_CONNECT
|
exit $E_CONNECT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean queue
|
|
||||||
rm -f $VESTA/data/queue/dns-cluster.pipe
|
|
||||||
touch $VESTA/data/queue/dns-cluster.pipe
|
|
||||||
chmod 660 $VESTA/data/queue/dns-cluster.pipe
|
|
||||||
|
|
||||||
# Start user loop
|
# Start user loop
|
||||||
for user in $user_list; do
|
for user in $user_list; do
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ case $queue in
|
||||||
backup) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
|
backup) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
|
||||||
disk) bash $VESTA/data/queue/$queue.pipe ;;
|
disk) bash $VESTA/data/queue/$queue.pipe ;;
|
||||||
traffic) bash $VESTA/data/queue/$queue.pipe ;;
|
traffic) bash $VESTA/data/queue/$queue.pipe ;;
|
||||||
dns-cluster) bash $VESTA/data/queue/$queue.pipe ;;
|
dns-cluster) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
|
||||||
*) check_args '1' '0' 'QUEUE' ;;
|
*) check_args '1' '0' 'QUEUE' ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue