Make docker check for hostname on start and change if needed

This commit is contained in:
Tiago Jacobs 2020-04-08 03:02:27 -03:00
parent f83bb3f561
commit 6bd54fcb87

View File

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