From 6bd54fcb8754e0168584c98e3a8418d263962999 Mon Sep 17 00:00:00 2001 From: Tiago Jacobs Date: Wed, 8 Apr 2020 03:02:27 -0300 Subject: [PATCH] Make docker check for hostname on start and change if needed --- rc.local | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rc.local b/rc.local index 847b148..e321519 100644 --- a/rc.local +++ b/rc.local @@ -1,3 +1,13 @@ #!/bin/sh -/usr/bin/bbb-conf --restart +BBB_HOST=`cat /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties | grep 'bigbluebutton.web.serverURL=' | awk -F '://' '{print $2}'` +THIS_HOST=`hostname -f` + +if [ "$BBB_HOST" != "$THIS_HOST" ] ; then + sed -i 's/'$BBB_HOST'/'$THIS_HOST'/g' /etc/nginx/sites-available/bigbluebutton + mv /etc/letsencrypt/live/$BBB_HOST /etc/letsencrypt/live/$THIS_HOST + /usr/bin/bbb-conf --setip "$THIS_HOST" +else + /usr/bin/bbb-conf --restart +fi; +