Skip to content

Commit f89a666

Browse files
author
Serghey Rodin
committed
LE cronjob for sys queue
1 parent a2fa6b7 commit f89a666

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

bin/v-add-cron-letsencrypt-job

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# info: add letsencrypt cronjob
3+
# options: NONE
4+
#
5+
# The script for enabling letsencrypt cronjob
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Includes
13+
source $VESTA/func/main.sh
14+
source $VESTA/conf/vesta.conf
15+
16+
17+
#----------------------------------------------------------#
18+
# Verifications #
19+
#----------------------------------------------------------#
20+
21+
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
22+
23+
24+
#----------------------------------------------------------#
25+
# Action #
26+
#----------------------------------------------------------#
27+
28+
# Add cron job
29+
cmd="sudo /usr/local/vesta/bin/v-update-sys-queue letsencrypt"
30+
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
31+
if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
32+
$BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
33+
fi
34+
35+
36+
#----------------------------------------------------------#
37+
# Vesta #
38+
#----------------------------------------------------------#
39+
40+
# Logging
41+
log_event "$OK" "$ARGUMENTS"
42+
43+
exit

bin/v-update-sys-queue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ fi
4848

4949
# Defining pipe functions
5050
case $queue in
51-
restart) bash $VESTA/data/queue/$queue.pipe ;;
51+
restart) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1;;
5252
webstats) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
5353
backup) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
54-
disk) bash $VESTA/data/queue/$queue.pipe ;;
55-
traffic) bash $VESTA/data/queue/$queue.pipe ;;
54+
disk) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1;;
55+
traffic) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1;;
5656
dns-cluster) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
57+
letsencrypt) bash $VESTA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
5758
*) check_args '1' '0' 'QUEUE' ;;
5859
esac
5960

0 commit comments

Comments
 (0)