Skip to content

Commit

Permalink
LE cronjob for sys queue
Browse files Browse the repository at this point in the history
  • Loading branch information
Serghey Rodin committed Oct 31, 2016
1 parent a2fa6b7 commit f89a666
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
43 changes: 43 additions & 0 deletions bin/v-add-cron-letsencrypt-job
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions bin/v-update-sys-queue
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f89a666

Please sign in to comment.