From f89a66654393cbd7004199260d0b5055ee6a9d75 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 31 Oct 2016 12:00:14 +0200 Subject: [PATCH] LE cronjob for sys queue --- bin/v-add-cron-letsencrypt-job | 43 ++++++++++++++++++++++++++++++++++ bin/v-update-sys-queue | 7 +++--- 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100755 bin/v-add-cron-letsencrypt-job diff --git a/bin/v-add-cron-letsencrypt-job b/bin/v-add-cron-letsencrypt-job new file mode 100755 index 00000000..19b6de7c --- /dev/null +++ b/bin/v-add-cron-letsencrypt-job @@ -0,0 +1,43 @@ +#!/bin/bash +# info: add letsencrypt cronjob +# options: NONE +# +# The script for enabling letsencrypt cronjob + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Includes +source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM' + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Add cron job +cmd="sudo /usr/local/vesta/bin/v-update-sys-queue letsencrypt" +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 # +#----------------------------------------------------------# + +# Logging +log_event "$OK" "$ARGUMENTS" + +exit diff --git a/bin/v-update-sys-queue b/bin/v-update-sys-queue index 77da8ee4..08e940ec 100755 --- a/bin/v-update-sys-queue +++ b/bin/v-update-sys-queue @@ -48,12 +48,13 @@ fi # Defining pipe functions case $queue in - restart) bash $VESTA/data/queue/$queue.pipe ;; + restart) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1;; webstats) 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 ;; - traffic) bash $VESTA/data/queue/$queue.pipe ;; + disk) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1;; + traffic) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1;; dns-cluster) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;; + letsencrypt) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;; *) check_args '1' '0' 'QUEUE' ;; esac