Fix ssl workaround

This commit is contained in:
Luis Guzmán 2019-04-01 23:15:11 -06:00
parent 4fb8a6e17a
commit 2cfb19ea29
No known key found for this signature in database
GPG Key ID: BE0F0FDD8926E0C5
1 changed files with 18 additions and 15 deletions

View File

@ -29,13 +29,15 @@ Webserver already installed!
" "
elif [ "$APACHE_2" -eq 1 ] && [ "$NGINX" -eq 0 ]; then elif [ "$APACHE_2" -eq 1 ] && [ "$NGINX" -eq 0 ]; then
apt -yqq install python3-certbot-apache echo "
Apache webserver already installed!
"
else else
echo " echo "
Installing nginx as webserver! Installing nginx as webserver!
" "
apt -yqq install nginx install_ifnot nginx
fi fi
} }
check_snd_driver() { check_snd_driver() {
@ -211,9 +213,9 @@ WAN_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
ssl_wa() { ssl_wa() {
service $1 stop service $1 stop
letsencrypt certonly --standalone --renew-by-default --agree-tos --email $SYSADMIN_EMAIL -d $DOMAIN letsencrypt certonly --standalone --renew-by-default --agree-tos --email $5 -d $6
sed -i "s|/etc/jitsi/meet/$DOMAIN.crt|/etc/letsencrypt/live/$DOMAIN/fullchain.pem|" $WS_CONF sed -i "s|/etc/jitsi/meet/$3.crt|/etc/letsencrypt/live/$3/fullchain.pem|" $4
sed -i "s|/etc/jitsi/meet/$DOMAIN.key|/etc/letsencrypt/live/$DOMAIN/privkey.pem|" $WS_CONF sed -i "s|/etc/jitsi/meet/$3.key|/etc/letsencrypt/live/$3/privkey.pem|" $4
service $1 restart service $1 restart
#Add cron #Add cron
crontab -l | { cat; echo "@weekly certbot renew --${2}"; } | crontab - crontab -l | { cat; echo "@weekly certbot renew --${2}"; } | crontab -
@ -231,16 +233,6 @@ echo '
#bash /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh #bash /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
update_certbot update_certbot
#SSL workaround
if [ "$APACHE_2" -eq 1 ]; then
ssl_wa apache2 apache
install_ifnot python3-certbot-apache
elif [ "$NGINX" -eq 1 ]; then
ssl_wa nginx nginx
install_ifnot python3-certbot-nginx
fi
else else
echo "SSL setup will be skipped." echo "SSL setup will be skipped."
@ -517,6 +509,17 @@ restart_services
enable_letsencrypt enable_letsencrypt
#SSL workaround
if [ "$(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed")" -eq 1 ]; then
ssl_wa apache2 apache $DOMAIN $WS_CONF $SYSADMIN_EMAIL $DOMAIN
install_ifnot python3-certbot-apache
elif [ "$(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed")" -eq 1 ]; then
ssl_wa nginx nginx $DOMAIN $WS_CONF $SYSADMIN_EMAIL $DOMAIN
install_ifnot python3-certbot-nginx
else
echo "No webserver found please report."
fi
echo " echo "
######################################################################## ########################################################################
Installation complete!! Installation complete!!