mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Adding restart parameter to v-install-unsigned-ssl
This commit is contained in:
parent
2edeee1f7f
commit
3648afaab5
1 changed files with 12 additions and 7 deletions
|
@ -1,14 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script will install unsigned SSL to desired domain
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: v-install-unsigned-ssl DOMAIN"
|
||||
exit 1
|
||||
echo "usage: v-install-unsigned-ssl DOMAIN [RESTART]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
domain=$1
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
restart='yes'
|
||||
else
|
||||
restart=$2
|
||||
fi
|
||||
|
||||
|
||||
user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
|
||||
|
||||
if [ ! -d "/home/$user" ]; then
|
||||
|
@ -27,7 +32,7 @@ TMPLOC="/home/$user/tmp/$domain"
|
|||
mkdir $TMPLOC
|
||||
|
||||
# Generating SSL certificate
|
||||
/usr/local/vesta/bin/v-generate-ssl-cert $domain $email 'US' 'California' 'San Francisco' 'myVesta Control Panel' 'IT' "www.$domain" > $TMPLOC/vst.pem
|
||||
/usr/local/vesta/bin/v-generate-ssl-cert $domain $email 'US' 'California' 'San Francisco' 'Vesta Control Panel' 'IT' "www.$domain" > $TMPLOC/vst.pem
|
||||
|
||||
# Parsing certificate file
|
||||
crt_end=$(grep -n "END CERTIFICATE-" $TMPLOC/vst.pem |cut -f 1 -d:)
|
||||
|
@ -48,10 +53,10 @@ get_domain_values 'web'
|
|||
if [[ $SSL == 'no' ]]
|
||||
then
|
||||
#Configure SSL and install the cert
|
||||
/usr/local/vesta/bin/v-add-web-domain-ssl $user $domain $TMPLOC
|
||||
/usr/local/vesta/bin/v-add-web-domain-ssl $user $domain $TMPLOC "same" "$restart"
|
||||
else
|
||||
#Replace the existing cert with the new one
|
||||
/usr/local/vesta/bin/v-change-web-domain-sslcert $user $domain $TMPLOC
|
||||
/usr/local/vesta/bin/v-change-web-domain-sslcert $user $domain $TMPLOC "$restart"
|
||||
fi
|
||||
|
||||
rm -rf $TMPLOC
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue