From 3648afaab5ec2ba8dce1371d76c5ba69147b832a Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sat, 27 Jun 2020 17:04:01 +0200 Subject: [PATCH] Adding restart parameter to v-install-unsigned-ssl --- bin/v-install-unsigned-ssl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/v-install-unsigned-ssl b/bin/v-install-unsigned-ssl index e0fdd46d..3c939e50 100644 --- a/bin/v-install-unsigned-ssl +++ b/bin/v-install-unsigned-ssl @@ -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