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; +