mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Update v-install-unsigned-ssl
This commit is contained in:
parent
ade95317d1
commit
94ffccf1b0
1 changed files with 28 additions and 1 deletions
|
@ -1,5 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# info: install unsigned SSL to domain
|
||||
# options: DOMAIN [RESTART]
|
||||
#
|
||||
# The function install unsigned SSL to domain
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument definition
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: v-install-unsigned-ssl DOMAIN [RESTART]"
|
||||
exit 1
|
||||
|
@ -13,6 +24,9 @@ else
|
|||
restart=$2
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
|
||||
|
||||
|
@ -26,6 +40,10 @@ if [ ! -d "/home/$user/web/$domain/public_html" ]; then
|
|||
exit 1;
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
email="info@$domain"
|
||||
|
||||
TMPLOC="/home/$user/tmp/$domain"
|
||||
|
@ -45,6 +63,7 @@ sed -n "1,${crt_end}p" $TMPLOC/vst.pem > $TMPLOC/$domain.crt
|
|||
sed -n "$key_start,${key_end}p" $TMPLOC/vst.pem > $TMPLOC/$domain.key
|
||||
chmod 666 $TMPLOC/*
|
||||
|
||||
source /usr/local/vesta/func/main.sh
|
||||
source /usr/local/vesta/func/domain.sh
|
||||
|
||||
USER_DATA="/usr/local/vesta/data/users/$user";
|
||||
|
@ -61,4 +80,12 @@ fi
|
|||
|
||||
rm -rf $TMPLOC
|
||||
|
||||
exit 0
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue