I want to edit this script to add ssl and try again if it fails until I finish adding the certificate and then finish the script and start virtual host >> Can this be used ?? To fulfill my purposes
sitesAvailabledomainSSL=/etc/apache2/sites-available/$2-le-ssl.conf
if [ ! -e "$sitesAvailabledomainSSL" ]; then
echo 1 | certbot -d "$2"
else
echo 1 | certbot --expand -d "$4"
fi
virtualHostStart='### start virtual host'
virtualHostStart="${virtualHostStart} ${1}"
virtualHostEnd='### end virtual host'
virtualHostEnd="${virtualHostEnd} ${1}"
### regular expression to remove wrong virtual host from the SSL file
sed -zE -i "s/<IfModule mod_ssl.c>(\r\n|\r|\n)<VirtualHost \*\:80>(\r\n|\r|\n)$virtualHostStart.*?
$virtualHostEnd(\r\n|\r|\n)<\/VirtualHost>(\r\n|\r|\n)<\/IfModule>//" /etc/apache2/sites-available/$3-le-ssl.conf
### restart Apache
/etc/init.d/apache2 reload
fi
any suggestions?
Aucun commentaire:
Enregistrer un commentaire