mirror of
https://github.com/myvesta/vesta.git
synced 2024-11-03 04:00:20 -08:00
44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/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
|