mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 04:51:54 -07:00
added scheduled LE install
This commit is contained in:
parent
56182cecf4
commit
15e7887cd5
1 changed files with 62 additions and 0 deletions
62
bin/v-schedule-letsencrypt-domain
Executable file
62
bin/v-schedule-letsencrypt-domain
Executable file
|
@ -0,0 +1,62 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# info: adding cronjob for letsencrypt cetificate installation
|
||||||
|
# options: USER DOMAIN [ALIASES]
|
||||||
|
#
|
||||||
|
# The function adds cronjob for letsencrypt ssl certificate installation
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Variable&Function #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Argument definition
|
||||||
|
user=$1
|
||||||
|
domain=$2
|
||||||
|
aliases=$3
|
||||||
|
|
||||||
|
# Includes
|
||||||
|
source $VESTA/func/main.sh
|
||||||
|
source $VESTA/func/domain.sh
|
||||||
|
source $VESTA/conf/vesta.conf
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Verifications #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
check_args '2' "$#" 'USER DOMAIN [ALIASES]'
|
||||||
|
is_format_valid 'user' 'domain'
|
||||||
|
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
|
||||||
|
is_system_enabled "$WEB_SSL" 'SSL_SUPPORT'
|
||||||
|
is_object_valid 'user' 'USER' "$user"
|
||||||
|
is_object_unsuspended 'user' 'USER' "$user"
|
||||||
|
is_object_valid 'web' 'DOMAIN' "$domain"
|
||||||
|
is_object_unsuspended 'web' 'DOMAIN' "$domain"
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Action #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Parsing domain aliases
|
||||||
|
if [ -z "$aliases" ]; then
|
||||||
|
get_domain_values 'web'
|
||||||
|
aliases="$ALIAS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Adding cronjob scheduler for LE
|
||||||
|
$BIN/v-add-cron-letsencrypt-job
|
||||||
|
|
||||||
|
# Adding LE task
|
||||||
|
echo "$BIN/v-add-letsencrypt-domain $user $domain '$aliases' yes yes" \
|
||||||
|
>> $VESTA/data/queue/letsencrypt.pipe
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Vesta #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
log_event "$OK" "$ARGUMENTS"
|
||||||
|
|
||||||
|
exit
|
Loading…
Add table
Add a link
Reference in a new issue