#!/bin/sh sudo apt-get -y update sudo apt-get -y dist-upgrade if [ -f /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties ]; then SERVLET_DIR=/usr/share/bbb-web else SERVLET_DIR=/var/lib/tomcat7/webapps/bigbluebutton fi BBB_WEB_URL=$(cat ${SERVLET_DIR}/WEB-INF/classes/bigbluebutton.properties | grep -v '#' | sed -n '/^bigbluebutton.web.serverURL/{s/.*=//;p}') RESULT=$(echo $BBB_WEB_URL | awk 'sub(/^.{8}/,"")') MY_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) #This should be dropped into apply-config.sh, but for now we are going to call it here once we update the instance. #xmlstarlet edit --inplace --update '//X-PRE-PROCESS[@cmd="set" and starts-with(@data, "external_rtp_ip=")]/@data' --value "external_rtp_ip=$MY_IP" /opt/freeswitch/conf/vars.xml bbb-conf --setip $RESULT bbb-conf --restart