From 541639cc9ed7ba12c76abcaffca5b77d9bdbbdbd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 21 Jan 2018 10:18:25 +0000 Subject: [PATCH] Update mumble certs during upgrades --- src/freedombone-app-mumble | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/freedombone-app-mumble b/src/freedombone-app-mumble index 6dc411ff..8a785f3c 100755 --- a/src/freedombone-app-mumble +++ b/src/freedombone-app-mumble @@ -84,6 +84,21 @@ function upgrade_mumble { if [ -d /etc/letsencrypt ]; then usermod -a -G ssl-cert mumble-server fi + + if [ ! -f /etc/letsencrypt/live/${DEFAULT_DOMAIN_NAME}/fullchain.pem ]; then + if ! grep -q "mumble.pem" /etc/mumble-server.ini; then + sed -i 's|sslCert=.*|sslCert=/var/lib/mumble-server/mumble.pem|g' /etc/mumble-server.ini + sed -i 's|sslKey=.*|sslKey=/var/lib/mumble-server/mumble.key|g' /etc/mumble-server.ini + systemctl restart mumble + fi + else + if ! grep -q "${DEFAULT_DOMAIN_NAME}/fullchain.pem" /etc/mumble-server.ini; then + usermod -a -G ssl-cert mumble-server + sed -i "s|sslCert=.*|sslCert=/etc/letsencrypt/live/${DEFAULT_DOMAIN_NAME}/fullchain.pem|g" /etc/mumble-server.ini + sed -i "s|sslKey=.*|sslKey=/etc/letsencrypt/live/${DEFAULT_DOMAIN_NAME}/privkey.pem|g" /etc/mumble-server.ini + systemctl restart mumble + fi + fi } function backup_local_mumble {