2012-02-24 02:52:13 +08:00
#!/bin/bash
2009-11-04 08:33:36 +08:00
#
2013-01-27 22:44:40 +08:00
# BlueButton open source conferencing system - http://www.bigbluebutton.org/
2009-11-04 08:33:36 +08:00
#
2013-01-27 22:44:40 +08:00
# Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
#
# This program is free software; you can redistribute it and/or modify it under the
2009-11-04 08:33:36 +08:00
# terms of the GNU Lesser General Public License as published by the Free Software
2013-01-27 22:44:40 +08:00
# Foundation; either version 3.0 of the License, or (at your option) any later
2009-11-04 08:33:36 +08:00
# version.
#
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
2009-12-12 05:20:34 +08:00
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
2009-11-04 08:33:36 +08:00
#
# Author(s):
# Fred Dixon <ffdixon@bigbluebutton.org>
2013-01-27 22:44:40 +08:00
# Sebastian Schneider <seb.sschneider@gmail.com>
2009-11-04 08:33:36 +08:00
#
# Changelog:
2010-10-10 04:39:06 +08:00
# 2009-10-18 FFD Inital Version
# 2009-11-05 FFD Updated for 0.62
# 2009-12-09 FFD Updated for 0.63
# 2009-12-11 FFD Added ability to swtich conference servers
# 2009-12-12 FFD Added cleaning and watching of log files
# 2010-01-05 FFD Added zipping of log files
# 2010-01-18 FFD Added resetting of environment back to using packages
# 2010-03-02 JRT Added trunk checkout options / fixed bbb-apps instructions
# 2010-04-02 FFD Updated for 0.64
2010-10-17 10:45:42 +08:00
# 2010-06-21 SEB Cleaned up some code / Updated for 0.70
# 2010-06-25 SEB Added ability to change the security salt
# 2010-06-30 SEB Added some extra errorchecking
2010-11-07 04:06:17 +08:00
# 2010-07-06 SEB Added more error checking and report messages
2010-10-17 10:45:42 +08:00
# 2010-09-15 FFD Updates for 0.71-dev
# 2010-10-16 FFD Updates for 0.71-beta
2010-11-07 04:06:17 +08:00
# 2010-11-06 FFD Added logic to ensure red5 shuts down
2010-12-13 02:31:41 +08:00
# 2010-12-12 FFD Fixed bug #778
2010-12-13 09:12:22 +08:00
# 2010-12-12 FFD Added support for Intalio VM
2011-03-01 10:19:23 +08:00
# 2010-02-28 FFD Fixed #834
2011-06-27 01:42:31 +08:00
# 2011-06-26 FFD Updates for 0.8
2012-01-16 09:20:24 +08:00
# 2012-01-14 FFD Tsting the development environment for 0.8
2012-02-23 06:33:22 +08:00
# 2012-02-22 FFD Updates to development environment
2012-04-26 08:54:51 +08:00
# 2012-04-27 FFD Added sum of version numbers in --check
2013-02-04 06:08:38 +08:00
# 2013-02-03 FFD Updated for changes to parameters for 0.81 in bigbluebutton-sip.properties
2009-11-04 08:33:36 +08:00
2012-10-29 09:51:26 +08:00
#set -x
2012-01-16 09:20:24 +08:00
#set -e
2009-11-04 08:33:36 +08:00
2012-02-26 09:35:58 +08:00
PATH=$PATH:/sbin
2010-12-13 09:12:22 +08:00
2011-05-28 06:54:09 +08:00
FREESWITCH_INIT_D="/etc/init.d/bbb-freeswitch"
2012-02-28 23:06:29 +08:00
source /etc/bigbluebutton/bigbluebutton-release
2010-12-13 09:12:22 +08:00
2010-12-14 10:25:59 +08:00
if [ ! -f /usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml ]; then
echo "#"
2012-01-16 09:20:24 +08:00
echo "# BigBlueButton does not appear to be installed. Could not"
echo "# locate:"
2010-12-14 10:25:59 +08:00
echo "#"
2012-01-16 09:20:24 +08:00
echo "# /usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml"
2010-12-14 10:25:59 +08:00
exit 1
fi
2012-01-22 05:40:40 +08:00
#
# We're going to give ^bigbluebutton.web.logoutURL a default value so bbb-conf does not give a warning
#
if [ -f /var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties ]; then
if cat /var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | grep -q ^bigbluebutton.web.logoutURL=$; then
sudo sed -i s/^bigbluebutton.web.logoutURL=$/bigbluebutton.web.logoutURL=default/g /var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties
fi
fi
2010-09-20 09:47:17 +08:00
#
2010-12-13 09:12:22 +08:00
# Figure out if we're using Asterisk or FreeSWITCH
2010-09-20 09:47:17 +08:00
#
2010-10-08 02:56:33 +08:00
if cat /usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml | grep -v '<!--' | grep -q 'bbb-voice-asterisk.xml'; then
VOICE_CONFERENCE="bbb-voice-asterisk.xml"
elif cat /usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml | grep -v '<!--' | grep -q 'bbb-voice-freeswitch.xml'; then
VOICE_CONFERENCE="bbb-voice-freeswitch.xml"
fi
2010-09-20 09:47:17 +08:00
2010-12-13 09:12:22 +08:00
#
# Determine IP so it works on multilingual installations
#
2010-11-10 20:49:46 +08:00
IP=$(ifconfig | grep -v '127.0.0.1' | grep -E "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" | head -1 | cut -d: -f2 | awk '{ print $1}')
2012-01-22 05:40:40 +08:00
MEM=`free -m | grep Mem | awk '{ print $2}'`
2010-09-20 09:47:17 +08:00
2010-12-13 09:12:22 +08:00
#
# Figure out our environemtn
#
PLATFORM=ubuntu
RED5_DIR=/usr/share/red5
SERVLET_CONTAINER=tomcat6
SERVLET_LOGS=/var/lib/tomcat6/logs
SERVLET_DIR=/var/lib/tomcat6/webapps
if [ -f /etc/lsb-release ]; then
if grep -q Ubuntu /etc/lsb-release; then
if [ -f /etc/init.d/cloud ]; then
#
# Support configuration on Intalio Cloud VM
#
2010-12-14 10:25:59 +08:00
PLATFORM=ubuntu-jetty-intalio
2010-12-13 09:12:22 +08:00
SERVLET_CONTAINER=cloud
SERVLET_LOGS=/var/www/cloud/jetty/logs
2011-03-01 10:19:23 +08:00
SERVLET_DIR=/var/www/cloud/webapps
2010-12-13 09:12:22 +08:00
fi
fi
fi
2010-10-31 05:41:21 +08:00
#
2010-12-13 09:12:22 +08:00
# Check if the function has a value and, if not, print an error message
2010-10-31 05:41:21 +08:00
# $1 -- name of value
# $2 -- loctation of value
# $3 -- value to check
#
check_no_value() {
if [ -z $3 ]; then
echo "# Tried to check $1 in"
echo "# $2"
echo "# but value is empty."
exit 1
fi
}
check_file() {
if [ ! -f $1 ]; then
2010-10-31 07:45:50 +08:00
echo "# File does not exist: $1"
2010-10-31 05:41:21 +08:00
fi
}
2009-11-06 04:57:56 +08:00
print_header() {
if [ ! $HEADER ]; then
2010-02-09 05:22:16 +08:00
echo
2010-07-16 00:55:42 +08:00
echo "** Potential problems described below **"
2009-11-06 04:57:56 +08:00
HEADER=1
fi
}
2009-11-04 08:33:36 +08:00
check_root() {
if [ $EUID == 0 ]; then
2010-03-03 12:55:48 +08:00
echo "This operation should not be run as root."
2009-11-04 08:33:36 +08:00
echo
echo "If this operation needs to execute an operation as root, you'll be asked for"
echo "your password to execute the operation using sudo."
exit 1
fi
}
2009-12-12 05:20:34 +08:00
need_root() {
if [ $EUID != 0 ]; then
2009-12-13 22:34:01 +08:00
echo "Need to be root to run this option"
2009-12-12 05:20:34 +08:00
exit 1
fi
}
2012-01-16 09:20:24 +08:00
2009-12-10 06:49:49 +08:00
usage() {
2012-02-28 23:06:29 +08:00
echo "BigBlueButton Configuration Utility - Version $BIGBLUEBUTTON_RELEASE"
2010-07-05 22:39:13 +08:00
echo "http://code.google.com/p/bigbluebutton/wiki/BBBConf"
2010-04-03 01:37:06 +08:00
echo
2010-12-14 10:25:59 +08:00
echo " bbb-conf [options]"
2010-04-03 01:37:06 +08:00
echo
echo "Configuration:"
echo " --version Display BigBlueButton version (packages)"
echo " --setip <host> Set IP/hostname for BigBlueButton"
2013-06-15 17:28:18 +08:00
echo " --setsecret <secret> Change the shared secret in bigbluebutton.properties"
2010-04-03 01:37:06 +08:00
echo
echo "Monitoring:"
2012-02-23 06:33:22 +08:00
echo " --check Check configuration files and processes for problems"
2010-04-03 01:37:06 +08:00
echo " --debug Scan the log files for error messages"
2010-04-03 03:25:02 +08:00
echo " --watch Scan the log files for error messages every 2 seconds"
2013-06-15 17:28:18 +08:00
echo " --secret View the URL and shared secret for the server"
2012-10-29 05:58:34 +08:00
echo " --lti View the URL and secret for LTI (if installed)"
2010-04-03 01:37:06 +08:00
echo
2010-12-14 10:25:59 +08:00
echo "Administration:"
2010-04-03 01:37:06 +08:00
echo " --restart Restart BigBueButton"
2010-10-10 06:10:24 +08:00
echo " --stop Stop BigBueButton"
echo " --start Start BigBueButton"
echo " --clean Restart and clean all log files"
2010-04-03 01:37:06 +08:00
echo " --zip Zip up log files for reporting an error"
echo
2012-02-26 09:35:58 +08:00
2010-04-03 01:37:06 +08:00
echo
2009-11-04 08:33:36 +08:00
}
# utility function to make a copy of the conf file
check_and_backup () {
# can we write to the configuration file?
if [ ! -w $1 ]; then
echo "Cannot write to $1!"
exit 1
fi
# let's see if we need a copy
if [ "$TO_BACKUP" = "Y" ]; then
cp $1 $1.bak
TO_BACKUP="N"
fi
}
# 3 paramenter: the file, the variable name, the new value
change_var_value () {
check_and_backup $1
sed -i "s<^[[:blank:]#]*\(${2}\).*<\1=\"${3}\"<" $1
}
2010-08-27 02:34:03 +08:00
change_var_ip () {
check_and_backup $1
sed -i "s<^[[:blank:]#]*\(${2}\).*<\1=${3}<" $1
}
2010-09-20 09:47:17 +08:00
2010-07-01 03:50:31 +08:00
# same as change_var_value but without quotes
change_var_salt() {
check_and_backup $1
sed -i "s<^[[:blank:]#]*\(${2}\).*<\1="${3}"<" $1
}
2010-09-20 09:47:17 +08:00
2009-11-04 08:33:36 +08:00
# comment lines matching $2 ($1 is the file)
comment () {
check_and_backup $1
sed -i "s<^[[:blank:]]*\(${2}.*\)<#\1<" $1
}
2010-09-20 09:47:17 +08:00
2011-07-10 23:54:43 +08:00
change_yml_value () {
sed -i "s<^[[:blank:]#]*\(${2}\):[ ].*<\1: ${3}<" $1
}
2009-11-04 08:33:36 +08:00
# comment lines matching $2 ($1 is the file)
uncomment () {
check_and_backup $1
sed -i "s<^[#[:blank:]]*\(${2}.*\)<\1<" $1
}
2010-03-25 21:55:39 +08:00
stop_bigbluebutton () {
2010-10-10 04:39:06 +08:00
/etc/init.d/red5 stop
2010-12-13 09:12:22 +08:00
/etc/init.d/${SERVLET_CONTAINER} stop
2010-10-10 04:39:06 +08:00
/etc/init.d/nginx stop
2010-08-23 21:49:54 +08:00
if [ -a /opt/freeswitch/run/freeswitch.pid ]; then
2011-05-28 06:54:09 +08:00
$FREESWITCH_INIT_D stop
2010-08-23 21:49:54 +08:00
fi
if [ -a /var/run/asterisk/asterisk.pid ]; then
/etc/init.d/asterisk stop
fi
2010-12-13 09:12:22 +08:00
if [ -f /etc/init.d/bbb-openoffice-headless ]; then
/etc/init.d/bbb-openoffice-headless stop
fi
2011-08-26 06:47:03 +08:00
if [ -f /etc/init.d/bbb-record-core ]; then
/etc/init.d/bbb-record-core stop
fi
2010-03-25 21:55:39 +08:00
}
2010-09-16 00:03:31 +08:00
2010-03-25 21:55:39 +08:00
start_bigbluebutton () {
2010-09-20 09:47:17 +08:00
if [ "$VOICE_CONFERENCE" == "bbb-voice-freeswitch.xml" ]; then
2010-11-05 09:48:48 +08:00
echo "Starting FreeSWITCH"
2011-05-28 06:54:09 +08:00
$FREESWITCH_INIT_D start
2010-09-20 09:47:17 +08:00
else
2010-09-16 04:21:55 +08:00
echo "Starting Asterisk"
2010-08-23 21:49:54 +08:00
/etc/init.d/asterisk start
fi
2010-10-10 06:10:24 +08:00
if [ "$VOICE_CONFERENCE" == "bbb-voice-freeswitch.xml" ]; then
2010-10-17 09:27:12 +08:00
FREESWITCH_ESL_IP=$(sudo cat /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml | grep 'name="listen-ip"' | cut -d\" -f4 | awk '{print $1}')
2010-10-31 07:49:42 +08:00
check_no_value listen-ip /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml $FREESWITCH_ESL_IP
2010-10-17 08:51:49 +08:00
2010-11-05 09:48:48 +08:00
echo -n "Waiting for FreeSWITCH to start: "
2010-10-10 06:10:24 +08:00
2010-10-31 08:28:27 +08:00
if [ ! -z $FREESWITCH_ESL_IP ]; then
2010-10-31 07:49:42 +08:00
while ! nc -z -w 1 $FREESWITCH_ESL_IP 8021; do
echo -n "."
sleep 1
done
fi
2010-10-10 06:10:24 +08:00
echo
else
echo -n "Waiting for Asterisk to start: "
while ! nc -z -w 1 127.0.0.1 5038; do
echo -n "."
sleep 1
done
fi
2010-12-13 09:12:22 +08:00
if [ -f /etc/init.d/bbb-openoffice-headless ]; then
/etc/init.d/bbb-openoffice-headless start
fi
2010-03-25 21:55:39 +08:00
/etc/init.d/nginx start
/etc/init.d/red5 start
2010-12-13 09:12:22 +08:00
/etc/init.d/${SERVLET_CONTAINER} start
2010-10-10 06:35:15 +08:00
2011-08-26 06:47:03 +08:00
if [ -f /etc/init.d/bbb-record-core ]; then
/etc/init.d/bbb-record-core start
fi
2010-10-10 06:35:15 +08:00
#
2010-12-13 09:12:22 +08:00
# At this point the red5 and servlet container applications are starting up.
2010-10-10 06:35:15 +08:00
#
2010-10-25 09:38:07 +08:00
echo -n "Waiting for BigBlueButton to finish starting up (this may take a minute): "
2010-10-10 06:35:15 +08:00
NGINX_IP=$(cat /etc/nginx/sites-available/bigbluebutton | sed -n '/server_name/{s/.*name[ ]*//;s/;//;p}')
2010-10-31 05:41:21 +08:00
check_no_value server_name /etc/nginx/sites-available/bigbluebutton $NGINX_IP
2010-11-07 04:06:17 +08:00
if ! nc -z -w 1 127.0.0.1 9123; then
while ! nc -z -w 1 127.0.0.1 9123; do
echo -n "."
sleep 1
done
fi
2010-12-14 10:25:59 +08:00
if [ $PLATFORM == "ubuntu-jetty-intalio" ]; then
2010-12-14 08:25:34 +08:00
#
# Wait until jetty has finished starting before checking for bbb-web
#
if ! nc -z -w 1 127.0.0.1 8443; then
while ! nc -z -w 1 127.0.0.1 8443; do
echo -n "."
sleep 5
done
fi
fi
2010-12-13 09:12:22 +08:00
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
2010-12-13 02:31:41 +08:00
if ! wget http://$BBB_WEB/bigbluebutton/api -O - --quiet | grep -q SUCCESS; then
echo "Startup unsuccessful: could not connect to http://$BBB_WEB/bigbluebutton/api"
2010-10-31 05:41:21 +08:00
exit 1
2010-11-07 04:06:17 +08:00
fi
2010-11-07 04:35:59 +08:00
echo " done"
2010-03-25 21:55:39 +08:00
}
display_bigbluebutton_status () {
/etc/init.d/nginx status
/etc/init.d/red5 status
2010-12-13 09:12:22 +08:00
/etc/init.d/${SERVLET_CONTAINER} status
2010-03-25 21:55:39 +08:00
}
2012-02-23 06:33:22 +08:00
2010-08-31 21:48:54 +08:00
if [ $# -eq 0 ]; then
usage
exit 1
fi
2009-11-04 08:33:36 +08:00
# Parse the parameters
while [ $# -gt 0 ]; do
2010-10-10 06:10:24 +08:00
if [ "$1" = "-stop" -o "$1" = "--stop" ]; then
stop_bigbluebutton
exit 0
fi
if [ "$1" = "-start" -o "$1" = "--start" ]; then
start_bigbluebutton
exit 0
fi
2009-11-06 02:33:28 +08:00
if [ "$1" = "-check" -o "$1" = "--check" -o "$1" = "-c" ]; then
2009-11-04 08:33:36 +08:00
CHECK=1
2010-07-08 04:17:55 +08:00
shift;shift
2009-11-05 12:08:22 +08:00
continue
2009-11-04 08:33:36 +08:00
fi
2009-11-04 09:18:58 +08:00
if [ "$1" = "--setup-samba" -o "$1" = "-setup-samba" ]; then
SAMBA=1
2009-11-06 02:33:28 +08:00
shift
continue
fi
if [ "$1" = "--version" -o "$1" = "-version" -o "$1" = "-v" ]; then
VERSION=1
shift
2009-11-04 09:18:58 +08:00
continue
fi
2009-12-10 06:49:49 +08:00
if [ "$1" = "--debug" -o "$1" = "-debug" -o "$1" = "-d" ]; then
DEBUG=1
shift
continue
fi
2010-01-16 22:28:53 +08:00
if [ "$1" = "--clean" -o "$1" = "-clean" ]; then
2009-12-13 01:56:14 +08:00
CLEAN=1
shift
continue
fi
if [ "$1" = "--watch" -o "$1" = "-watch" -o "$1" = "-w" ]; then
WATCH=1
shift
continue
fi
2009-12-13 22:34:01 +08:00
if [ "$1" = "--network" -o "$1" = "-network" -o "$1" = "-n" ]; then
NETWORK=1
shift
continue
fi
2010-01-06 07:57:22 +08:00
if [ "$1" = "--zip" -o "$1" = "-zip" -o "$1" = "-z" ]; then
ZIP=1
shift
continue
fi
2010-01-19 10:20:22 +08:00
if [ "$1" = "--reset-dev" -o "$1" = "-reset-dev" -o "$1" = "-r" ]; then
2013-04-11 10:07:22 +08:00
echo
echo "This option is depreciated. See "
echo
echo " https://code.google.com/p/bigbluebutton/wiki/081DevelopingBigBlueButton "
echo
echo "for instructions on how to setup a development environment."
exit 0
2010-01-19 10:20:22 +08:00
fi
2010-03-25 21:55:39 +08:00
if [ "$1" = "--restart" -o "$1" = "-restart" ]; then
RESTART=1
shift
continue
fi
2009-11-04 08:33:36 +08:00
#
# all other parameters requires at least 1 argument
#
if [ "$1" = "-setip" -o "$1" = "--setip" ]; then
2009-11-05 12:08:22 +08:00
HOST="${2}"
2010-09-20 09:47:17 +08:00
if [ -z "$HOST" ]; then
echo "HOST IP=$IP"
2010-08-31 02:28:27 +08:00
fi
2010-03-09 23:32:20 +08:00
if echo $HOST|grep -q ":"; then
HOST=`echo ${2}|cut -d: -f1`
fi
2009-11-04 08:33:36 +08:00
shift; shift
continue
fi
2010-07-01 03:50:31 +08:00
if [ "$1" = "--setup-dev" -o "$1" = "-setup-dev" ]; then
2013-04-11 10:07:22 +08:00
echo
echo "This option is depreciated. See "
echo
echo " https://code.google.com/p/bigbluebutton/wiki/081DevelopingBigBlueButton "
echo
echo "for instructions on how to setup a development environment."
exit 0
2010-07-01 03:50:31 +08:00
fi
2010-07-01 03:28:54 +08:00
if [ "$1" = "--conference" -o "$1" = "-conference" ]; then
CONFERENCE="${2}"
2010-09-20 09:47:17 +08:00
confapp=$(cat /usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties | grep 'asterisk.application' | sed s/.*=//g);
if [ -z "$CONFERENCE" ] ; then
2010-08-31 02:28:27 +08:00
if [ $confapp == "meetme" ]; then
2010-09-20 09:47:17 +08:00
echo "Current conference application is $confapp"
2010-10-08 02:56:33 +08:00
elif [ $confapp == "konference" ] && [ "$VOICE_CONFERENCE" == "bbb-voice-asterisk.xml" ]; then
2010-09-20 09:47:17 +08:00
echo "Current conference application is $confapp"
2010-10-08 02:56:33 +08:00
elif [ "$VOICE_CONFERENCE" == "bbb-voice-freeswitch.xml" ]; then
2010-09-20 09:47:17 +08:00
echo "Current conference application is freeswitch"
2010-08-31 02:28:27 +08:00
fi
2010-09-20 09:47:17 +08:00
exit 0
2010-08-31 02:28:27 +08:00
fi
2010-06-26 00:11:36 +08:00
shift; shift
continue
2010-07-01 03:28:54 +08:00
fi
2010-07-01 03:50:31 +08:00
2010-11-05 09:48:48 +08:00
if [ "$1" = "--salt" -o "$1" = "-salt" -o "$1" = "--setsalt" ]; then
2010-07-01 03:50:31 +08:00
SALT="${2}"
2010-09-20 09:47:17 +08:00
if [ -z "$SALT" ]; then
2010-12-13 09:12:22 +08:00
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
SALT=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | grep securitySalt | cut -d= -f2);
2010-11-05 09:48:48 +08:00
echo
2010-12-13 02:31:41 +08:00
echo " URL: http://$BBB_WEB/bigbluebutton/"
2010-11-05 09:48:48 +08:00
echo " Salt: $SALT"
echo
exit 0
2010-08-31 02:28:27 +08:00
fi
2010-07-01 03:50:31 +08:00
shift; shift
continue
fi
2009-12-12 05:20:34 +08:00
2013-06-15 17:28:18 +08:00
if [ "$1" = "--secret" -o "$1" = "-secret" -o "$1" = "--setsecret" ]; then
SALT="${2}"
if [ -z "$SALT" ]; then
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
SALT=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | grep securitySalt | cut -d= -f2);
echo
echo " URL: http://$BBB_WEB/bigbluebutton/"
echo " Secret: $SALT"
echo
exit 0
fi
shift; shift
continue
fi
2012-10-29 05:58:34 +08:00
if [ "$1" = "--lti" -o "$1" = "-lti" ]; then
if [ -z "$SALT" ]; then
if [ -f ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties ]; then
LTI_URL=$(cat ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties | sed -n '/^ltiEndPoint/{s/^.*=//;p}')
CUSTOMER=$(cat ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties | sed -n '/^ltiConsumer/{s/^.*=//;s/:.*//p}')
SECRET=$(cat ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties | sed -n '/^ltiConsumer/{s/^[^:]*://;p}')
echo
echo " URL: $LTI_URL"
echo " Customer: $CUSTOMER"
echo " Secret: $SECRET"
echo
2013-06-09 05:15:58 +08:00
ICON_URL=$( echo $LTI_URL | sed 's/tool.xml/images\/icon.ico/')
2012-10-30 02:53:37 +08:00
echo " Icon URL: $ICON_URL"
echo
echo
2012-10-29 05:58:34 +08:00
exit 0
fi
fi
shift; shift
continue
fi
2009-11-04 08:33:36 +08:00
usage
exit 1
done
#
# Version
#
if [ $VERSION ]; then
2011-03-01 10:19:23 +08:00
echo
dpkg -l | grep bbb
2009-11-04 08:33:36 +08:00
exit 0
fi
2009-11-04 09:18:58 +08:00
#
2010-09-20 09:47:17 +08:00
# Set Security Salt
# - XXX
2009-11-04 09:18:58 +08:00
#
2010-07-01 03:50:31 +08:00
if [ $SALT ]; then
need_root
2011-06-27 01:42:31 +08:00
change_var_salt ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties securitySalt $SALT
2013-06-15 17:28:18 +08:00
echo "Changed BigBlueButton's shared secret to $SALT"
2012-01-22 05:40:40 +08:00
echo
2010-07-01 03:50:31 +08:00
fi
2010-09-20 09:47:17 +08:00
#
# Setup samba
#
2009-11-04 09:18:58 +08:00
if [ $SAMBA ]; then
2010-01-24 12:00:01 +08:00
check_root
2009-11-04 09:18:58 +08:00
#
# Instal Samba
#
if ! dpkg-query -s samba > /dev/null 2>&1; then
2009-11-07 00:15:45 +08:00
sudo apt-get install -y --force-yes samba ant
2009-11-04 09:18:58 +08:00
fi
#
# Add a share to samba
#
if ! grep -q $USER /etc/samba/smb.conf; then
echo ";
; BigBlueButton: Share the development directory
[$USER]
comment = BigBlueButton Development share
path = /home/$USER
browseable = yes
read only = no
create mask = 0755
directory mask = 0775
guest ok = yes
force user = $USER
" | sudo tee -a /etc/samba/smb.conf > /dev/null 2>&1
2010-07-13 21:20:22 +08:00
sudo /etc/init.d/smbd restart
2009-11-04 09:18:58 +08:00
echo "
You can now access your development folder through:
2010-01-24 12:00:01 +08:00
\\\\${IP}\\$USER
2009-11-04 09:18:58 +08:00
If you are running a development environment on Windows (such as using Eclipse or FlexBuilder),
you can map the above path to a drive letter.
"
else
echo "Already detected a definition for $USER in /etc/samba/smb.conf"
echo "No changes were made to /etc/samba/smb.conf"
fi
fi
2010-10-31 05:41:21 +08:00
check_configuration() {
#
# Check if we've got the voice conference servers properly installed and configured
#
if [ "$VOICE_CONFERENCE" == "bbb-voice-freeswitch.xml" ]; then
2013-04-10 08:42:38 +08:00
if [ ! -d /opt/freeswitch/conf/jingle_profiles ]; then
echo
echo "# You have an older version of FreeSWITCH installed. To upgrade"
echo "# enter the following commands"
echo "# "
echo "# sudo apt-get remove bbb-freeswitch"
echo "# sudo apt-get install bigbluebutton"
echo "# "
echo
fi
2010-10-31 05:41:21 +08:00
#
# Check that freeswtich ESL matches the value in bigbluebutton.properties
#
if [ -f /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml ]; then
FREESWITCH_ESL_IP=$(sudo cat /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml | grep 'name="listen-ip"' | cut -d\" -f4 | awk '{print $1}')
check_no_value event_socket /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml $FREESWITCH_ESL_IP
2013-02-04 06:08:38 +08:00
ESL_HOST=$(cat /usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties | grep esl.host | sed 's/freeswitch.esl.host=//g')
2010-10-31 05:41:21 +08:00
check_no_value esl.host /usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties $ESL_HOST
if [ "$FREESWITCH_ESL_IP" != "$ESL_HOST" ]; then
echo
echo "# The values for listen-ip in "
echo "# /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml"
echo "# do not match the settings for esl.host in"
echo "# /usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties"
echo
fi
fi
else
if [ ! -x /usr/sbin/asterisk ]; then
echo
echo "# BigBlueButton is configured to use asterisk but could not find "
echo "# /usr/sbin/asterisk"
echo
fi
if [ ! -f /usr/lib/asterisk/modules/app_konference.so ]; then
echo
echo "# Did not detect the BigBlueButton configuration setup for asterisk. Missing"
echo "# /usr/lib/asterisk/modules/app_konference.so"
echo "# Try running: sudo apt-get install bbb-voice-conference"
echo
fi
fi
#
# Check if BigBlueButto is defined in Nginx
#
2010-12-14 10:25:59 +08:00
if [ $PLATFORM != "ubuntu-jetty-intalio" ]; then
if [ ! -L /etc/nginx/sites-enabled/bigbluebutton ]; then
echo "# Nginx: BigBlueButton appears to be disabled"
echo " - no symbolic link in /etc/nginx/sites-enabled/bigbluebutton to /etc/nginx/sites-available/bigbluebutton "
fi
2010-10-31 05:41:21 +08:00
fi
#
# Look for properties with no values set
#
CONFIG_FILES="$RED5_DIR/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties \
2010-12-13 09:12:22 +08:00
${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties \
2010-10-31 05:41:21 +08:00
$RED5_DIR/webapps/sip/WEB-INF/bigbluebutton-sip.properties"
for file in $CONFIG_FILES ; do
if [ ! -f $file ]; then
echo "# Error: File not found: $file"
else
if grep -q "^[^=]*=[ ]*$" $file; then
2012-01-16 09:20:24 +08:00
echo "# The following properties in $file have no value:"
echo "# $(grep '^[^=#]*=[ ]*$' $file | sed 's/=//g')"
2010-10-31 05:41:21 +08:00
fi
fi
done
#
# Check that the supporting applications are installed
#
2010-12-13 09:12:22 +08:00
VARFolder=$(cat $SERVLET_DIR/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | grep swfToolsDir | cut -d= -f2)
2010-10-31 05:41:21 +08:00
if [ ! -x $VARFolder/pdf2swf ] && [ ! -x $VARFolder/jpeg2swf ] && [ ! -x $VARFolder/png2swf ]; then
echo "# pdf2swf, jpeg2swf and png2swf are not installed in $VARFolder"
fi
2010-12-13 09:12:22 +08:00
VARFolder=$(cat $SERVLET_DIR/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | grep imageMagickDir | cut -d= -f2)
2010-10-31 05:41:21 +08:00
if [ ! -x $VARFolder/convert ]; then
echo "# ImageMagick's convert is not installed in $VARFolder"
fi
2010-12-13 09:12:22 +08:00
VARFolder=$(cat $SERVLET_DIR/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | grep ghostScriptExec | cut -d= -f2)
2010-10-31 05:41:21 +08:00
if [ ! -x $VARFolder ]; then
echo "# Ghostscript is not installd in $VARFolder"
fi
#
# Check if the IP resolves to a different host
#
NGINX_IP=$(cat /etc/nginx/sites-available/bigbluebutton | sed -n '/server_name/{s/.*name[ ]*//;s/;//;p}')
check_no_value server_name /etc/nginx/sites-available/bigbluebutton $NGINX_IP
HOSTS=$(which host)
if [ $HOSTS ]; then
HOSTS=`$HOSTS $NGINX_IP | awk '{ print $4 }'`
fi
if [ "$IP" != "$NGINX_IP" ]; then
if [ "$IP" != "$HOSTS" ]; then
echo "# IP does not match:"
echo "# IP from ifconfig: $IP"
echo "# /etc/nginx/sites-available/bigbluebutton: $NGINX_IP"
fi
fi
2011-08-08 22:11:05 +08:00
if [ -f ${SERVLET_DIR}/demo/bbb_api_conf.jsp ]; then
#
# Make sure the salt for the API matches the server
#
SALT_PROPERTIES=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | tr -d '\r' | sed -n '/securitySalt/{s/.*=//;p}')
SALT_DEMO=$(cat ${SERVLET_DIR}/demo/bbb_api_conf.jsp | tr -d '\r' | sed -n '/salt[ ]*=/{s/.*=[ ]*"//;s/".*//g;p}')
if [ "$SALT_PROPERTIES" != "$SALT_DEMO" ]; then
2012-02-26 09:35:58 +08:00
echo "# Warning: API Salt mismatch: "
2012-10-31 09:10:48 +08:00
echo "# ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties = $SALT_PROPERTIES"
echo "# ${SERVLET_DIR}/demo/bbb_api_conf.jsp = $SALT_DEMO"
2012-03-05 08:18:35 +08:00
echo
2011-08-08 22:11:05 +08:00
fi
API_IP=$(cat ${SERVLET_DIR}/demo/bbb_api_conf.jsp | sed -n '/String BigBlueButtonURL/{s/.*http:\/\///;s/\/.*//;p}' | tr -d '\015')
if [ "$IP" != "$API_IP" ]; then
2012-02-26 09:35:58 +08:00
echo "# Warning: API URL IPs do not match host:"
2012-03-05 08:18:35 +08:00
echo "#"
2011-08-08 22:11:05 +08:00
echo "# IP from ifconfig: $IP"
echo "# ${SERVLET_DIR}/demo/bbb_api_conf.jsp: $API_IP"
2012-03-05 08:18:35 +08:00
echo
2011-08-08 22:11:05 +08:00
fi
fi
2012-10-31 09:10:48 +08:00
if [ -f ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties ]; then
LTI_SALT=$(cat ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties | tr -d '\r' | sed -n '/^bigbluebuttonSalt/{s/.*=//;p}')
BBB_SALT=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | tr -d '\r' | sed -n '/securitySalt/{s/.*=//;p}')
if [ "$LTI_SALT" != "$BBB_SALT" ]; then
echo "# Warning: LTI Salt mismatch:"
echo "# ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties = $LTI_SALT"
echo "# ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties = $BBB_SALT"
echo
fi
fi
2010-10-31 05:41:21 +08:00
}
2010-01-16 10:40:58 +08:00
check_state() {
2010-07-08 05:11:27 +08:00
echo
2010-07-08 04:17:55 +08:00
print_header
2010-10-31 05:41:21 +08:00
check_configuration
2010-01-16 22:28:53 +08:00
2009-11-06 06:48:31 +08:00
#
2010-10-10 04:39:06 +08:00
# Check for potential problems in the BigBlueButton configuration
2009-11-06 06:48:31 +08:00
#
2010-09-20 09:47:17 +08:00
2010-07-08 01:52:49 +08:00
RUNNING_APPS=""
NOT_RUNNING_APPS=""
2010-09-20 09:47:17 +08:00
2010-07-08 04:17:55 +08:00
if ! ps aux | grep -v grep | grep 'org.red5.server.Bootstrap' > /dev/null; then
2009-11-06 04:57:56 +08:00
print_header
2010-11-05 09:48:48 +08:00
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} red5"
2010-07-08 01:52:49 +08:00
else
2010-11-05 09:48:48 +08:00
RUNNING_APPS="${RUNNING_APPS} red5"
2009-11-06 04:57:56 +08:00
fi
2010-10-10 04:39:06 +08:00
# Check asterisk if asterisk has been started
# same for freeswitch
2010-08-24 02:28:37 +08:00
if [ -a /var/run/asterisk/asterisk.pid ] && [ -a /opt/freeswitch/run/freeswitch.pid ]; then
2009-11-06 04:57:56 +08:00
print_header
2010-10-31 07:45:50 +08:00
echo
2010-11-05 09:48:48 +08:00
echo "# Asterisk and FreeSWITCH are running parallel"
2010-10-31 05:41:21 +08:00
echo "# Please run bbb-conf --conference with either freeswitch or asterisk and"
echo "# Uninstall on or the other."
2010-10-31 07:45:50 +08:00
echo
2010-08-24 02:28:37 +08:00
elif [ -a /var/run/asterisk/asterisk.pid ]; then
2010-10-10 04:39:06 +08:00
if ! ps aux | grep -v grep | grep '[/]usr/sbin/asterisk' > /dev/null; then
print_header
2010-11-05 09:48:48 +08:00
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} asterisk"
2010-10-10 04:39:06 +08:00
else
2010-11-05 09:48:48 +08:00
RUNNING_APPS="${RUNNING_APPS} asterisk"
2010-10-10 04:39:06 +08:00
fi
2010-08-24 02:28:37 +08:00
elif [ -a /opt/freeswitch/run/freeswitch.pid ]; then
if ! ps aux | grep -v grep | grep '[/]opt/freeswitch/bin/freeswitch' > /dev/null; then
print_header
2010-11-05 09:48:48 +08:00
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} freeswitch"
2010-08-24 02:28:37 +08:00
else
2010-11-05 09:48:48 +08:00
RUNNING_APPS="${RUNNING_APPS} freeswitch"
2010-08-24 02:28:37 +08:00
fi
2010-08-24 00:12:04 +08:00
fi
2013-03-30 10:00:46 +08:00
if ! ps aux | grep -v grep | grep '[/]usr/lib/openoffice/program/soffice.bin' > /dev/null; then
if ! ps aux | grep -v grep | grep '[/]usr/lib/libreoffice/program/soffice.bin' > /dev/null; then
print_header
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} OpenOffice or LibreOffice"
fi
else
RUNNING_APPS="${RUNNING_APPS} OpenOffice"
fi
2009-11-06 04:57:56 +08:00
2010-07-08 04:17:55 +08:00
if ! ps aux | grep -v grep | grep '[/]usr/sbin/nginx' > /dev/null; then
2009-11-06 07:14:17 +08:00
print_header
2010-07-08 01:52:49 +08:00
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} Nginx"
else
RUNNING_APPS="${RUNNING_APPS} Nginx"
2009-11-06 07:14:17 +08:00
fi
2009-11-06 04:57:56 +08:00
if ! netstat -ant | grep '8080' > /dev/null; then
print_header
2010-12-13 09:12:22 +08:00
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} ${SERVLET_CONTAINER} or grails"
2009-12-12 05:20:34 +08:00
else
2010-07-08 04:17:55 +08:00
if ps aux | ps -aef | grep -v grep | grep grails | grep run-app > /dev/null; then
2009-12-12 05:20:34 +08:00
print_header
2010-07-08 01:52:49 +08:00
RUNNING_APPS="${RUNNING_APPS} Grails"
2010-12-13 09:12:22 +08:00
echo "# ${SERVLET_CONTAINER}: noticed you are running grails run-app instead of ${SERVLET_CONTAINER}"
2010-07-08 01:52:49 +08:00
else
2010-12-13 09:12:22 +08:00
RUNNING_APPS="${RUNNING_APPS} ${SERVLET_CONTAINER}"
2009-12-12 05:20:34 +08:00
fi
fi
2009-11-06 04:57:56 +08:00
2010-07-08 01:52:49 +08:00
if ! netstat -ant | grep '8100' > /dev/null; then
print_header
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} OpenOffice"
else
RUNNING_APPS="${RUNNING_APPS} OpenOffice"
fi
2010-09-20 09:47:17 +08:00
2011-08-21 03:13:03 +08:00
if ! ps aux | grep -v grep | grep '[/]usr/bin/redis-server' > /dev/null; then
print_header
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} redis-server"
else
2011-08-26 06:47:03 +08:00
RUNNING_APPS="${RUNNING_APPS} redis-server"
fi
if ! ps -C god > /dev/null; then
print_header
NOT_RUNNING_APPS="${NOT_RUNNING_APPS} bbb-record-core"
else
RUNNING_APPS="${RUNNING_APPS} bbb-record-core"
2011-08-21 03:13:03 +08:00
fi
2010-07-08 04:17:55 +08:00
#echo " Running: ${RUNNING_APPS}"
if [ "$NOT_RUNNING_APPS" != "" ]; then
2010-10-31 05:41:21 +08:00
echo "# Not Running: ${NOT_RUNNING_APPS}"
2010-07-08 04:17:55 +08:00
fi
2010-09-20 09:47:17 +08:00
#
2010-10-31 05:41:21 +08:00
# Check if running development environment
2010-09-20 09:47:17 +08:00
#
2012-02-24 02:52:13 +08:00
if ! grep /var/www/bigbluebutton /etc/bigbluebutton/nginx/client.nginx > /dev/null; then
2012-02-26 09:35:58 +08:00
NEW_LOCATION=$(cat /etc/bigbluebutton/nginx/client.nginx | sed -n '/root/{s/[ \t]*root[ \t]*//;s/;//;p}' | head -n 1)
2012-03-04 09:35:28 +08:00
echo "# Warning: nginx is not serving the client from /var/www/bigbluebutton/."
echo "# Instead, it's being served from"
2012-02-26 09:35:58 +08:00
echo "#"
echo "# $NEW_LOCATION"
2012-02-24 02:52:13 +08:00
echo "#"
2012-03-04 09:35:28 +08:00
echo "# (This is OK if you have setup a development environment.) "
echo
2013-05-06 06:04:11 +08:00
if [ ! -d $NEW_LOCATION ]; then
echo "# Warning: The directory"
echo "#"
echo "# $NEW_LOCATION"
echo "#"
echo "# does not exist. The BigBlueButton client will not load."
echo
fi
2012-03-04 09:35:28 +08:00
fi
#
# Check if running development environment
#
if ! grep 8080 /etc/bigbluebutton/nginx/web.nginx > /dev/null; then
echo "# Warning: nginx is not serving BigBlueButton's web application"
echo "# from port 8080"
echo "#"
echo "# (This is OK if you have setup a development environment.) "
echo
2009-12-12 05:20:34 +08:00
fi
2010-09-20 09:47:17 +08:00
#
2010-10-10 04:39:06 +08:00
# Check red5 applictaions
2010-09-20 09:47:17 +08:00
#
2010-07-08 01:52:49 +08:00
AVAIL_RED5_APPS=""
UNAVAIL_RED5_APPS=""
2010-09-20 09:47:17 +08:00
DIRECTORIES="bigbluebutton sip video deskshare"
2009-11-06 06:48:31 +08:00
for dir in $DIRECTORIES ; do
2010-07-07 22:57:20 +08:00
if [ ! -d $RED5_DIR/webapps/$dir ]; then
2010-07-08 01:52:49 +08:00
UNAVAIL_RED5_APPS="${UNAVAIL_RED5_APPS} $dir"
else
AVAIL_RED5_APPS="${AVAIL_RED5_APPS} $dir"
2009-11-06 06:48:31 +08:00
fi
done
2010-09-20 09:47:17 +08:00
2010-07-08 04:17:55 +08:00
if [ "$UNAVAIL_RED5_APPS" != "" ]; then
2010-10-31 05:41:21 +08:00
echo "# Unavailable Red5 apps ($RED5_DIR/webapps/): ${UNAVAIL_RED5_APPS}"
2010-07-08 04:17:55 +08:00
fi
2010-09-20 09:47:17 +08:00
#
# Checking red5 apps log
#
RED5_LOG_FILES="bigbluebutton red5 sip video deskshare"
2010-07-08 01:52:49 +08:00
AVAIL_RED5_LOG=""
UNAVAIL_RED5_LOG=""
2009-11-06 06:48:31 +08:00
for file in $RED5_LOG_FILES ; do
2010-07-07 22:57:20 +08:00
if [ ! -f $RED5_DIR/log/$file.log ]; then
2010-07-08 01:52:49 +08:00
UNAVAIL_RED5_LOG="${UNAVAIL_RED5_LOG} $file.log"
else
AVAIL_RED5_LOG="${AVAIL_RED5_LOG} $file.log"
2009-11-06 06:48:31 +08:00
fi
done
2010-09-20 09:47:17 +08:00
2010-07-08 04:17:55 +08:00
if [ "$UNAVAIL_RED5_LOG" != "" ]; then
2010-10-31 05:41:21 +08:00
echo "# Unavailable Red5 logs ($RED5_DIR/log): $UNAVAIL_RED5_LOG"
2010-07-08 04:17:55 +08:00
fi
2010-09-20 09:47:17 +08:00
#
# Check if any of the red5 BigBlueButton applications did not start propery
#
2010-10-31 05:41:21 +08:00
BBB_APPS="sip video bigbluebutton deskshare"
2010-07-08 01:52:49 +08:00
for bbb_app in $BBB_APPS ; do
if [ -a $RED5_DIR/log/$bbb_app.log ]; then
if cat $RED5_DIR/log/$bbb_app.log | tail -n1 | grep -q "Starting up context"; then
2010-10-31 05:41:21 +08:00
echo "# $bbb_app did not start properly"
2010-07-01 03:57:39 +08:00
fi
else
2010-10-31 05:41:21 +08:00
echo "# $RED5_DIR/log/$bbb_app.log not found"
2010-07-01 03:57:39 +08:00
fi
done
2010-09-20 09:47:17 +08:00
2013-04-11 10:38:54 +08:00
#
# Check if any of the red5 BigBlueButton applications did not start propery
#
COMMANDS="ffmpeg ruby gem ghostscript pdf2swf"
for cmd in $COMMANDS ; do
if ! which $cmd > /dev/null; then
echo "# $cmd command not found"
fi
done
2010-09-20 09:47:17 +08:00
2010-10-17 10:45:42 +08:00
if [ -f /usr/share/red5/log/sip.log ]; then
#
# Checking if voice app registered with Asterisk successfully
#
if cat /usr/share/red5/log/sip.log | grep -q "Failed to register with Sip Server"; then
2012-02-20 01:34:21 +08:00
echo "# Error: The voice application failed to register with the sip server."
echo "# Try running: "
echo "#"
echo "# sudo bbb-conf --clean"
echo "#"
2012-03-04 09:35:28 +08:00
echo
2010-10-17 10:45:42 +08:00
fi
#
# check if sip.log has warnings where the user is not registered.
#
if cat /usr/share/red5/log/sip.log | tail -n1 | grep -q "Call request for default but not registered"; then
2012-02-20 01:34:21 +08:00
echo "# Error: The voice app is not registered with SIP server. Audio might not be working correctly."
2012-03-04 09:35:28 +08:00
echo
2010-10-17 10:45:42 +08:00
fi
else
2012-02-20 01:34:21 +08:00
echo "# Error: /usr/share/red5/log/sip.log"
2012-03-04 09:35:28 +08:00
echo
2010-07-07 22:32:16 +08:00
fi
2010-07-01 03:57:39 +08:00
2010-01-16 10:40:58 +08:00
#
2010-12-13 09:12:22 +08:00
# Check that the servlet container has started properly and has created log files
2010-01-16 10:40:58 +08:00
#
2010-12-13 09:12:22 +08:00
if [ -z "$(ls -A $SERVLET_LOGS)" ]; then
echo "# empty directory: $SERVLET_LOGS contains no logs"
2010-01-15 11:00:52 +08:00
fi
2010-01-13 11:44:50 +08:00
2010-01-16 10:40:58 +08:00
#
2010-09-20 09:47:17 +08:00
# Check that bigbluebutton in red5 has started propertly (less than 100 lines indicates that it
# didn't start)
2010-01-16 10:40:58 +08:00
#
2010-10-17 10:45:42 +08:00
if [ -f $RED5_DIR/log/bigbluebutton.log ]; then
BBB_RED5_LOG=$(stat -c%s $RED5_DIR/log/bigbluebutton.log)
if [ $BBB_RED5_LOG -lt 100 ]; then
2010-10-31 05:41:21 +08:00
echo "# bigbluebutton failed to start: $RED5_DIR/log/bigbluebutton.log (red5)"
2010-10-17 10:45:42 +08:00
fi
else
2010-10-31 05:41:21 +08:00
echo "# No $RED5_DIR/log/bigbluebutton.log"
2010-01-16 10:40:58 +08:00
fi
2012-03-04 09:35:28 +08:00
#
# Check if the user is running their own bbb-web
#
if grep -q 8888 /etc/bigbluebutton/nginx/web.nginx; then
if ! netstat -ant | grep '8888' > /dev/null; then
echo "# Warning: There is no application server listening to port 8888."
echo
fi
fi
2010-07-14 23:55:33 +08:00
2010-09-20 09:47:17 +08:00
#
# Check if the local server can access the API. This is a common problem when setting up BigBlueButton behind
# a firewall
#
2010-12-13 09:12:22 +08:00
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
2010-12-13 02:31:41 +08:00
check_no_value server_name /etc/nginx/sites-available/bigbluebutton $BBB_WEB
if ! wget http://$BBB_WEB/bigbluebutton/api -O - --quiet | grep -q SUCCESS; then
2012-03-04 09:35:28 +08:00
echo "# Error: Could not connect to the configured hostname/IP address"
2010-10-31 05:41:21 +08:00
echo "#"
2012-03-04 09:35:28 +08:00
echo "# http://$BBB_WEB/"
echo "#"
echo "# If your BigBlueButton server is behind a firewall, see FAQ:"
echo "#"
echo "# http://code.google.com/p/bigbluebutton/wiki/FAQ"
echo "#"
echo "# (See entry for setting up BigBlueButton behind a firewall.)"
echo
2010-09-20 09:47:17 +08:00
fi
2010-10-04 11:27:23 +08:00
#
# Check that BigBlueButton can connect to port 80, 1935, and 9123
#
2010-10-31 07:49:42 +08:00
if [ ! -z $NGINX_IP ]; then
if ! nc -z -w 3 $NGINX_IP 1935; then
2012-02-20 01:34:21 +08:00
echo "# Error: Unable to connect to port 1935 (RTMP) on $NGINX_IP"
2012-03-04 09:35:28 +08:00
echo
2010-10-31 07:49:42 +08:00
fi
2010-10-04 11:27:23 +08:00
2010-10-31 07:49:42 +08:00
if ! nc -z -w 3 $NGINX_IP 9123; then
2012-02-20 01:34:21 +08:00
echo "# Error: Unable to connect to port 9123 (desktop sharing) on $NGINX_IP"
2012-03-04 09:35:28 +08:00
echo
2010-10-31 07:49:42 +08:00
fi
2010-10-04 11:27:23 +08:00
fi
2010-10-17 10:45:42 +08:00
if [ "$VOICE_CONFERENCE" == "bbb-voice-asterisk.xml" ]; then
2012-02-20 01:34:21 +08:00
echo "# Error: You have freeswitch installed, but the current voice conference set"
2010-10-31 07:45:50 +08:00
echo "# to asterisk. To switch to freeswitch, enter"
echo "#"
echo "# sudo bbb-conf --conference freeswitch"
2012-03-04 09:35:28 +08:00
echo
2010-10-17 10:45:42 +08:00
fi
2010-11-07 04:06:17 +08:00
2013-02-04 06:08:38 +08:00
BBB_SIP_APP_IP=$(cat /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties | sed -n '/^bbb.sip.app.ip=/{s/.*=//;s/;//;p}')
if [ $BBB_SIP_APP_IP != "127.0.0.1" ]; then
if [ $BBB_SIP_APP_IP != $IP ]; then
echo "# Warning: The setting of ($BBB_SIP_APP_IP) for bbb.sip.app.ip in"
2012-03-04 09:35:28 +08:00
echo "#"
2011-11-09 10:51:53 +08:00
echo "# /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties"
2012-03-04 09:35:28 +08:00
echo "#"
2011-11-09 10:51:53 +08:00
echo "# does not match the local IP address ($IP)."
2013-02-04 06:08:38 +08:00
echo "# (This is OK if you've manually changed the values to an external "
echo "# FreeSWITCH server.)"
2012-03-04 09:35:28 +08:00
echo
2011-11-09 10:51:53 +08:00
fi
2012-01-22 05:40:40 +08:00
2012-02-13 00:47:56 +08:00
SIP_IP=$(netstat -ant | grep 5060 | head -n1 | awk -F" " '{print $4}' | cut -d: -f1)
2013-02-04 06:08:38 +08:00
if [ $BBB_SIP_APP_IP != $SIP_IP ]; then
2012-02-20 01:34:21 +08:00
echo "# Error: FreeSWITCH is listening on IP address $SIP_IP for SIP calls, but "
2013-02-04 06:08:38 +08:00
echo "# The IP address ($BBB_SIP_APP_IP) set bbb.sip.app.ip."
2012-01-22 05:40:40 +08:00
echo "#"
echo "# If your audio is not working (users click the headset icon "
2012-03-17 23:39:56 +08:00
echo "# and don't appear in the Listeners window, ensure FreeSWITCH uses"
echo "# the local loopback 127.0.0.1 address. See"
echo "# http://code.google.com/p/bigbluebutton/wiki/FAQ#Users_do_not_appear_in_the_listeners_window"
2012-03-04 09:35:28 +08:00
echo
2012-01-22 05:40:40 +08:00
fi
2010-11-07 04:06:17 +08:00
fi
2010-10-17 10:45:42 +08:00
2012-10-29 09:51:26 +08:00
if [ -d ${SERVLET_DIR}/lti ]; then
2012-10-29 05:58:34 +08:00
if test ${SERVLET_DIR}/lti.war -nt ${SERVLET_DIR}/lti; then
echo "# Error: The updated lti.war did not deploy. To manually deploy:"
echo "#"
echo "# sudo touch ${SERVLET_DIR}/lti.war"
echo "#"
echo
fi
fi
2011-11-21 03:15:07 +08:00
if [ -d ${SERVLET_DIR}/demo ]; then
if test ${SERVLET_DIR}/demo.war -nt ${SERVLET_DIR}/demo; then
2012-03-05 08:18:35 +08:00
echo "# Error: The updated demo.war did not deploy. To manually deploy:"
2011-11-21 03:15:07 +08:00
echo "#"
echo "# sudo touch ${SERVLET_DIR}/demo.war"
echo "#"
2012-03-04 09:35:28 +08:00
echo
2011-11-21 03:15:07 +08:00
fi
fi
2012-01-20 10:33:04 +08:00
if grep -q removeMeetingWhenEnded=false $SERVLET_DIR/bigbluebutton/WEB-INF/classes/bigbluebutton.properties; then
echo "# Warning: In"
echo "#"
echo "# $SERVLET_DIR/bigbluebutton/WEB-INF/classes/bigbluebutton.properties"
echo "#"
echo "# detected the setting"
echo "#"
echo "# removeMeetingWhenEnded=false"
echo "#"
2012-01-22 05:40:40 +08:00
echo "# You should set this value to true. It enables bbb-web to immediately purge a meeting from"
echo "# memory when receiving an end API call. Otherwise, users must wait about 2 minutes"
echo "# request before creating a meeting with the same meetingID but with different parameters."
2012-03-04 09:35:28 +08:00
echo
2012-01-20 10:33:04 +08:00
fi
2012-05-11 21:49:58 +08:00
if (( $MEM < 1975 )); then
2012-01-22 05:40:40 +08:00
echo "# Warning: You are running BigBlueButton on a server with less than 2G of memory. Your"
echo "# performance may suffer."
2012-03-04 09:35:28 +08:00
echo
2012-01-22 05:40:40 +08:00
fi
2012-01-20 10:33:04 +08:00
2012-02-20 01:34:21 +08:00
2012-10-29 09:51:26 +08:00
if [ -f ${SERVLET_DIR}/demo/demo1.jsp ]; then
2012-02-20 01:34:21 +08:00
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
2012-02-26 09:35:58 +08:00
echo "# Warning: The API demos are installed and accessible from:"
2012-02-20 01:34:21 +08:00
echo "#"
2012-03-05 11:16:37 +08:00
echo "# http://$BBB_WEB/"
2012-02-20 01:34:21 +08:00
echo "#"
2012-02-28 08:10:18 +08:00
echo "# Use the API demos test your BigBlueButton setup. To remove"
2012-02-20 01:34:21 +08:00
echo "#"
echo "# sudo apt-get purge bbb-demo"
2012-03-04 09:35:28 +08:00
echo
2012-02-20 01:34:21 +08:00
fi
2012-10-29 09:51:26 +08:00
if [ -f ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties ]; then
LTI_URL=$(cat ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties | sed -n '/^ltiEndPoint/{s/^.*=//;p}')
echo "# Warning: The IMS Learning Tools Integration (LTI) is accessible from:"
echo "#"
echo "# $LTI_URL"
echo "#"
echo "# To get the access parameters for LTI, run the command"
echo "#"
echo "# bbb-conf --lti"
echo
fi
2012-07-29 04:01:44 +08:00
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*=//;p}')
DEFAULT_PDF=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^beans.presentationService.defaultUploadedPresentation/{s/.*=//;p}')
if echo $DEFAULT_PDF | grep -q "bigbluebutton.web.serverURL"; then
if ! echo "$BBB_WEB$(echo $DEFAULT_PDF | sed 's/${bigbluebutton.web.serverURL}//g')" | xargs wget -q -O /dev/null; then
echo "# Error: Unable to reach default URL for presentation:"
echo "#"
echo "# $BBB_WEB$(echo $DEFAULT_PDF | sed 's/${bigbluebutton.web.serverURL}//g')"
echo "#"
echo "# Check value for beans.presentationService.defaultUploadedPresentation in"
echo "# ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties"
fi
else
if ! echo "$DEFAULT_PDF" | xargs wget -q -O /dev/null; then
echo "# Error: Unable to reach default URL for presentation"
echo "#"
echo "# $DEFAULT_PDF"
echo "#"
echo "# Check value for beans.presentationService.defaultUploadedPresentation in"
echo "# ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties"
fi
fi
2009-12-10 06:49:49 +08:00
exit 0
}
2009-11-06 06:48:31 +08:00
2009-12-10 06:49:49 +08:00
#
2010-10-10 04:39:06 +08:00
# Print out the status of the current setup and look for bugs.
2009-12-10 06:49:49 +08:00
#
if [ $CHECK ]; then
2010-10-31 05:41:21 +08:00
need_root
2010-11-05 09:48:48 +08:00
echo
2012-04-26 08:54:51 +08:00
echo "BigBlueButton Server $BIGBLUEBUTTON_RELEASE ($(dpkg -l | grep bbb | sed -n '/0.[0-9][0-9]ubuntu/{s/.*ubuntu//;s/;//;p}' | awk '{ sum+=$1} END {print sum}'))"
2010-10-04 11:27:23 +08:00
echo " Kernel version:" `uname -r`
if [ -e /etc/lsb-release ]; then
source /etc/lsb-release;
echo -n " Distribution: $DISTRIB_DESCRIPTION "
fi
2010-07-05 21:16:33 +08:00
if [ `uname -m` == "x86_64" ]; then
2010-11-05 09:48:48 +08:00
echo "(64-bit)"
2010-10-06 04:03:57 +08:00
elif [ `uname -m` == "i686" ]; then
2010-11-05 09:48:48 +08:00
echo "(32-bit)"
2010-07-05 21:16:33 +08:00
fi
2009-12-10 06:49:49 +08:00
2010-10-04 11:27:23 +08:00
echo " Memory: $MEM MB"
2010-08-31 21:48:54 +08:00
2010-10-10 04:39:06 +08:00
echo
2011-07-10 23:54:43 +08:00
echo "/var/www/bigbluebutton/client/conf/config.xml (bbb-client)"
2010-12-13 02:31:41 +08:00
PORT_IP=$(cat /var/www/bigbluebutton/client/conf/config.xml | sed -n '/porttest /{s/.*host="//;s/".*//;p}')
echo " Port test (tunnel): $PORT_IP"
2009-12-10 06:49:49 +08:00
2010-12-13 02:31:41 +08:00
RED5_IP=$(cat /var/www/bigbluebutton/client/conf/config.xml | sed -n '/uri.*video/{s/.*rtmp:\/\///;s/\/.*//;p}')
echo " Red5: $RED5_IP"
2009-12-10 06:49:49 +08:00
2010-07-08 01:52:49 +08:00
# HOST=$(cat /var/www/bigbluebutton/client/conf/config.xml | sed -n '/recordingHost/{s/.*recordingHost="http:\/\///;s/"//;p}')
# echo " host for bbb-web interface: $HOST"
2009-12-10 06:49:49 +08:00
2010-10-10 04:39:06 +08:00
echo
2011-07-10 23:54:43 +08:00
echo "/etc/nginx/sites-available/bigbluebutton (nginx)"
2010-12-13 02:31:41 +08:00
NGINX_IP=$(cat /etc/nginx/sites-available/bigbluebutton | sed -n '/server_name/{s/.*name[ ]*//;s/;//;p}')
echo " server name: $NGINX_IP"
2009-12-10 06:49:49 +08:00
2010-10-10 04:39:06 +08:00
PORT=$(cat /etc/nginx/sites-available/bigbluebutton | sed -n '/listen/{s/.*listen[ ]*//;s/;//;p}')
echo " port: $PORT"
2009-12-10 06:49:49 +08:00
2012-02-23 06:33:22 +08:00
BBB_CLIENT_DOC_ROOT=$(cat /etc/bigbluebutton/nginx/client.nginx | grep \/client -A 1 | head -n 2 | grep root | sed -n '{s/[ \t]*root[ ]*//;s/;//;p}')
2010-10-10 04:39:06 +08:00
echo " bbb-client dir: $BBB_CLIENT_DOC_ROOT"
2009-12-10 06:49:49 +08:00
2010-12-13 09:12:22 +08:00
BBB_WEB_IP=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
2010-10-10 04:39:06 +08:00
echo
2010-12-13 09:12:22 +08:00
echo "${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties (bbb-web)"
2010-12-13 02:31:41 +08:00
echo " bbb-web host: $BBB_WEB_IP"
2009-12-10 06:49:49 +08:00
2011-08-08 22:11:05 +08:00
if [ -f ${SERVLET_DIR}/demo/bbb_api_conf.jsp ]; then
API_IP=$(cat ${SERVLET_DIR}/demo/bbb_api_conf.jsp | sed -n '/String BigBlueButtonURL/{s/.*http:\/\///;s/\/.*//;p}' | tr -d '\015')
2010-10-10 04:39:06 +08:00
echo
2011-08-08 22:11:05 +08:00
echo "${SERVLET_DIR}/demo/bbb_api_conf.jsp (API demos)"
2012-03-04 09:35:28 +08:00
echo " api url: $API_IP"
2009-12-24 11:02:55 +08:00
fi
2012-10-30 02:53:37 +08:00
if [ -f ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties ]; then
LTI_URL=$(cat ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties | sed -n '/^bigbluebuttonURL/{s/.*http:\/\///;s/\/.*//;p}' | tr -d '\015')
echo
echo "${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties (LTI integration)"
echo " api url: $LTI_URL"
fi
2010-10-31 07:45:50 +08:00
if [ $VOICE_CONFERENCE == "bbb-voice-freeswitch.xml" ]; then
2010-10-08 02:56:33 +08:00
CONFERENCING_MODULE="FreeSWITCH"
2010-10-31 07:45:50 +08:00
else
2010-10-31 11:11:27 +08:00
CONFERENCING_MODULE="$(cat $RED5_DIR/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties | sed -n '/asterisk.application/{s/.*=[ ]*//g;p}') (asterisk)"
2010-01-16 22:28:53 +08:00
fi
2010-10-10 04:39:06 +08:00
echo
2011-07-10 23:54:43 +08:00
echo "/usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml (red5)"
2010-10-10 04:39:06 +08:00
echo " voice conference: $CONFERENCING_MODULE"
2010-10-08 02:56:33 +08:00
2012-08-22 07:17:14 +08:00
CAPTURE_VIDEO="$(cat /usr/share/red5/webapps/video/WEB-INF/red5-web.xml | sed -n '/recordVideoStream/{s/^.*="//g;s/"\/>//g;p}')"
echo " capture video: $CAPTURE_VIDEO"
2012-09-11 05:12:10 +08:00
if [ -f /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml ]; then
PLAYBACK_IP=$(cat /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml | sed -n '/playback_host/{s/.*:[ ]*//;s/;//;p}')
2011-07-10 23:54:43 +08:00
echo
2012-09-11 05:12:10 +08:00
echo "/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml (record and playback)"
2011-07-15 01:10:44 +08:00
echo " playback host: $PLAYBACK_IP"
2011-07-10 23:54:43 +08:00
fi
2010-01-16 22:28:53 +08:00
check_state
2010-10-08 02:56:33 +08:00
echo ""
2009-12-10 06:49:49 +08:00
exit 0
fi
2010-01-06 07:57:22 +08:00
#
# Check current setup
#
if [ $ZIP ]; then
need_root
LOG_FILE="$(date +'%Y%m%d')-$(date +%H)"
#
# Check log files
#
rm -f /tmp/$LOG_FILE.tar
rm -f /tmp/$LOG_FILE.tar.gz
rm -f /tmp/a
2010-01-15 11:00:52 +08:00
touch /tmp/empty
tar cf /tmp/$LOG_FILE.tar /tmp/empty > /dev/null 2>&1
2010-07-07 22:57:20 +08:00
tar rf /tmp/$LOG_FILE.tar $RED5_DIR/log > /dev/null 2>&1
2010-12-13 09:12:22 +08:00
tar rf /tmp/$LOG_FILE.tar $SERVLET_LOGS > /dev/null 2>&1
2010-01-13 11:44:50 +08:00
tar rf /tmp/$LOG_FILE.tar /var/log/bigbluebutton/* > /dev/null 2>&1
2010-01-06 07:57:22 +08:00
tar rf /tmp/$LOG_FILE.tar /var/log/nginx/error.log > /dev/null 2>&1
tar rf /tmp/$LOG_FILE.tar /var/log/syslog > /dev/null 2>&1
tar tf /tmp/$LOG_FILE.tar
gzip /tmp/$LOG_FILE.tar
2010-01-15 11:00:52 +08:00
mv /tmp/$LOG_FILE.tar.gz /root/$LOG_FILE.tar.gz
echo
echo " Created: /root/$LOG_FILE.tar.gz"
2010-01-06 07:57:22 +08:00
echo
fi
2009-12-10 06:49:49 +08:00
#
# Check current setup
#
if [ $DEBUG ]; then
2009-12-12 05:20:34 +08:00
need_root
2009-12-09 10:37:32 +08:00
#
# Check log files
#
2010-07-14 04:14:26 +08:00
rm -rf /tmp/t
grep ERROR /var/log/bigbluebutton/* > /tmp/t
if [ -s /tmp/t ]; then
echo " -- ERRORS found in /var/log/bigbluebutton/* -- "
cat /tmp/t
echo
fi
rm -rf /tmp/t
2010-07-14 07:09:50 +08:00
grep Exception /var/log/bigbluebutton/* | grep -v CacheExceptionHandlerFactory > /tmp/t
2010-07-14 04:14:26 +08:00
if [ -s /tmp/t ]; then
echo " -- ERRORS found in /var/log/bigbluebutton/* -- "
cat /tmp/t
echo
fi
2009-12-09 10:37:32 +08:00
rm -rf /tmp/t
2010-07-07 22:57:20 +08:00
grep ERROR $RED5_DIR/log/* > /tmp/t
2009-12-09 10:37:32 +08:00
if [ -s /tmp/t ]; then
2010-07-07 22:57:20 +08:00
echo " -- ERRORS found in $RED5_DIR/log/* -- "
2009-12-09 10:37:32 +08:00
cat /tmp/t
2010-10-10 04:39:06 +08:00
echo
2009-12-09 10:37:32 +08:00
fi
rm -rf /tmp/t
2010-07-07 22:57:20 +08:00
grep Exception $RED5_DIR/log/* > /tmp/t
2009-12-09 10:37:32 +08:00
if [ -s /tmp/t ]; then
2010-07-07 22:57:20 +08:00
echo " -- Exceptions found in $RED5_DIR/log/* -- "
2009-12-09 10:37:32 +08:00
cat /tmp/t
echo
fi
rm -rf /tmp/t
2010-10-17 09:27:12 +08:00
if [ -f /var/log/asterisk ]; then
find /var/log/asterisk -exec grep -H -i "Unable to register" '{}' \; > /tmp/t
if [ -s /tmp/t ]; then
echo " -- Registration errors found in /var/log/asterisk/ -- "
echo "Found $(cat /tmp/t | wc -l) errors in /var/log/asterisk/* containing string \"Unable to register\""
echo
fi
2009-12-09 10:37:32 +08:00
fi
rm -rf /tmp/t
2010-12-13 09:12:22 +08:00
sudo grep Exception $SERVLET_LOGS/* | grep -v CacheExceptionHandlerFactory > /tmp/t
2009-12-09 10:37:32 +08:00
if [ -s /tmp/t ]; then
2010-12-13 09:12:22 +08:00
echo " -- Exceptions found in $SERVLET_LOGS/ -- "
2009-12-09 10:37:32 +08:00
cat /tmp/t
echo
fi
2010-01-02 10:17:11 +08:00
rm -rf /tmp/t
if [ -s /var/log/nginx/error.log ]; then
cat /var/log/nginx/error.log | grep -v "/fcs/ident2" > /tmp/t
if [ -s /tmp/t ]; then
echo " -- Errors found in /var/log/nginx/error.log -- "
cat /tmp/t
echo
fi
fi
2009-12-12 05:20:34 +08:00
2009-12-13 22:34:01 +08:00
rm -rf /tmp/t
2010-03-09 23:32:20 +08:00
if [ ! is_gentoo ]; then sudo grep -v "No Voicetronix cards detected" /var/log/asterisk/* | grep ERROR > /tmp/t
if [ -s /tmp/t ]; then
2009-12-13 22:34:01 +08:00
echo " -- Errors found in /var/log/asterisk/* -- "
cat /tmp/t
echo
2010-03-09 23:32:20 +08:00
fi
2009-12-13 22:34:01 +08:00
fi
2009-12-12 05:20:34 +08:00
2009-12-20 07:33:29 +08:00
rm -rf /tmp/t
2010-03-09 23:32:20 +08:00
if [ ! is_gentoo ]; then sudo grep -i exception /var/log/syslog > /tmp/t
if [ -s /tmp/t ]; then
2009-12-20 07:33:29 +08:00
echo " -- Errors found in /var/log/syslog -- "
cat /tmp/t
echo
2010-03-09 23:32:20 +08:00
fi
2009-12-20 07:33:29 +08:00
fi
2009-12-24 11:02:55 +08:00
rm -rf /tmp/t
if [ -d /var/log/bigbluebutton ]; then
2010-03-09 23:32:20 +08:00
if [ ! is_gentoo ]; then
sudo grep ERROR /var/log/bigbluebutton/* > /tmp/t
if [ -s /tmp/t ]; then
2009-12-24 11:02:55 +08:00
echo " -- Errors found in /var/log/bigbluebutton -- "
cat /tmp/t
echo
2010-03-09 23:32:20 +08:00
fi
2009-12-24 11:02:55 +08:00
fi
fi
2009-12-20 07:33:29 +08:00
2010-01-08 01:52:48 +08:00
rm -rf /tmp/t
if [ -d /var/log/bigbluebutton ]; then
2010-03-09 23:32:20 +08:00
if [ ! is_gentoo ]; then
sudo grep -i exception /var/log/bigbluebutton/* > /tmp/t
if [ -s /tmp/t ]; then
2010-01-08 01:52:48 +08:00
echo " -- Exceptions found in /var/log/bigbluebutton -- "
cat /tmp/t
echo
2010-03-09 23:32:20 +08:00
fi
2010-01-08 01:52:48 +08:00
fi
fi
2011-06-27 01:42:31 +08:00
#
# Additional checks for record and playback
#
2013-04-13 00:20:52 +08:00
bbb-record --check
2011-06-27 01:42:31 +08:00
2009-11-04 08:33:36 +08:00
exit 0
fi
# if asked to print the version that's all we do
2009-11-05 12:08:22 +08:00
if [ -n "$HOST" ]; then
2009-11-04 08:33:36 +08:00
#
# Just use the IP for port test in /var/www/bigbluebutton/client/conf/config.xml
#
echo "Assigning $HOST for testing for firewall in /var/www/bigbluebutton/client/conf/config.xml"
sudo sed -i "s/porttest host=\(\"[^\"]*\"\)/porttest host=\"$HOST\"/g" /var/www/bigbluebutton/client/conf/config.xml
2010-09-20 09:47:17 +08:00
2009-11-04 08:33:36 +08:00
echo "Assigning $HOST for rtmp:// in /var/www/bigbluebutton/client/conf/config.xml"
sudo sed -i "s/rtmp:\/\/\([^\"\/]*\)\([\"\/]\)/rtmp:\/\/$HOST\2/g" /var/www/bigbluebutton/client/conf/config.xml
echo "Assigning $HOST for servername in /etc/nginx/sites-available/bigbluebutton"
sudo sed -i "s/server_name .*/server_name $HOST;/g" /etc/nginx/sites-available/bigbluebutton
#
# Update configuration for BigBlueButton client
#
echo "Assigning $HOST for http:// in /var/www/bigbluebutton/client/conf/config.xml"
sudo sed -i "s/http:\/\/\([^\"\/]*\)\([\"\/]\)/http:\/\/$HOST\2/g" /var/www/bigbluebutton/client/conf/config.xml
#
# Update configuration for BigBlueButton web app
#
2010-12-13 09:12:22 +08:00
echo "Assigning $HOST for web application URL in ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties"
2009-11-04 08:33:36 +08:00
sudo sed -i "s/bigbluebutton.web.serverURL=http:\/\/.*/bigbluebutton.web.serverURL=http:\/\/$HOST/g" \
2010-12-13 09:12:22 +08:00
${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties
2009-11-04 08:33:36 +08:00
2010-10-10 04:39:06 +08:00
# 3 paramenter: the file, the variable name, the new value
2010-12-13 09:12:22 +08:00
# echo "Assigning $HOST for FreeSWITCH Event Socket Layer URL in ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties"
2010-10-04 11:27:23 +08:00
# change_var_ip /usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties esl.host $HOST
2010-08-10 23:09:16 +08:00
2010-12-13 09:12:22 +08:00
# cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties
2009-11-04 08:33:36 +08:00
if ! grep -q server_names_hash_bucket_size /etc/nginx/nginx.conf; then
sudo sed -i "s/gzip on;/gzip on;\n server_names_hash_bucket_size 64;/g" /etc/nginx/nginx.conf
fi
2009-12-24 11:02:55 +08:00
#
# Update api demos
#
2011-08-08 22:11:05 +08:00
if [ -f ${SERVLET_DIR}/demo/bbb_api_conf.jsp ]; then
2011-08-19 01:56:31 +08:00
echo "Assigning $HOST for api demos in ${SERVLET_DIR}/demo/bbb_api_conf.jsp"
2009-12-31 04:53:15 +08:00
sudo sed -i "s/BigBlueButtonURL = \"http:\/\/\([^\"\/]*\)\([\"\/]\)/BigBlueButtonURL = \"http:\/\/$HOST\2/g" \
2011-08-08 22:11:05 +08:00
${SERVLET_DIR}/demo/bbb_api_conf.jsp
2010-10-10 04:39:06 +08:00
fi
2011-07-10 23:54:43 +08:00
2012-10-30 02:53:37 +08:00
if [ -f ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties ]; then
echo "Assigning $HOST for LTI integration in ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties"
sed -i "s/bigbluebuttonURL=http:\/\/.*/bigbluebuttonURL=http:\/\/$HOST\/bigbluebutton/g" \
${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties
2013-06-09 01:26:04 +08:00
sed -i "s/ltiEndPoint=http:\/\/.*/ltiEndPoint=http:\/\/$HOST\/lti\/tool/g" \
2012-10-30 02:53:37 +08:00
${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties
fi
2012-09-11 05:12:10 +08:00
if [ -f /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml ]; then
echo "Assigning $HOST for record and playback in /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml"
change_yml_value /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml $redis_host playback_host $HOST
2011-07-10 23:54:43 +08:00
fi
2012-08-28 04:34:31 +08:00
2012-09-13 02:53:21 +08:00
echo -n "Assigning $HOST for playback of recordings: "
TYPES=$(cd /usr/local/bigbluebutton/core/scripts/process; ls *.rb | sed s/.rb//g)
BASE=/var/bigbluebutton/recording
for type in $TYPES; do
for metadata in $(find $BASE/publish/$type -name metadata.xml); do
echo -n "."
2012-09-13 03:14:45 +08:00
sed -i "/<link>/{s/http:\/\/\([^\"\/]*\)\/playback\/$type\([^<]\)/http:\/\/$HOST\/playback\/$type\2/g}" $metadata
done
done
for type in $TYPES; do
for metadata in $(find /var/bigbluebutton/published/$type -name metadata.xml); do
echo -n "."
sed -i "/<link>/{s/http:\/\/\([^\"\/]*\)\/playback\/$type\([^<]\)/http:\/\/$HOST\/playback\/$type\2/g}" $metadata
2012-09-13 02:53:21 +08:00
done
done
echo
2010-08-27 03:25:34 +08:00
echo "Restarting the bigbluebutton server ..."
stop_bigbluebutton
echo
start_bigbluebutton
2009-11-04 08:33:36 +08:00
exit 0
fi
2009-12-12 05:20:34 +08:00
if [ $CONFERENCE ]; then
2010-01-16 22:28:53 +08:00
need_root
2010-07-07 22:57:20 +08:00
if [ ! -f $RED5_DIR/webapps/bigbluebutton/WEB-INF/bbb-voice-app.xml ]; then
2010-10-31 07:45:50 +08:00
echo
2010-10-31 05:41:21 +08:00
echo "# Unable to find $RED5_DIR/webapps/bigbluebutton/WEB-INF/bbb-voice-app.xml"
2009-12-12 05:20:34 +08:00
exit 1
fi
2010-08-26 01:01:15 +08:00
if [ "$CONFERENCE" = "freeswitch" ]; then
2010-08-23 21:49:54 +08:00
CONFERENCE=freeswitch
elif [ "$CONFERENCE" = "meetme" ]; then
2009-12-12 05:20:34 +08:00
CONFERENCE=meetme
2010-08-23 21:49:54 +08:00
else
2010-01-16 22:28:53 +08:00
if [ "$CONFERENCE" = "konference" ]; then
2009-12-13 22:34:01 +08:00
CONFERENCE=app_konference
2009-12-12 05:20:34 +08:00
else
2010-10-31 07:45:50 +08:00
echo
2010-08-23 21:49:54 +08:00
echo "Error: Valid options for --conference are: meetme, konference, freeswitch"
2010-02-09 05:22:16 +08:00
exit 1
2009-12-12 05:20:34 +08:00
fi
fi
2012-02-23 06:33:22 +08:00
#
# Depreciated
#
2010-10-10 04:39:06 +08:00
if [ $CONFERENCE = "meetme" ]; then
2010-10-17 09:27:12 +08:00
if [ ! -f /etc/asterisk/bbb_extensions.conf ]; then
2010-10-31 07:45:50 +08:00
echo
echo "# Unable to find /etc/asterisk/bbb_extensions.conf"
2010-10-17 09:27:12 +08:00
exit 1
fi
2010-01-16 22:28:53 +08:00
#
2010-07-07 22:57:20 +08:00
# update $RED5_DIR/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
2010-01-16 22:28:53 +08:00
#
2010-08-26 01:53:25 +08:00
# test this as a hack to check if the ip stays in listen-ip for event-conf.xml
2010-09-20 09:47:17 +08:00
# -- XXX
# EVENTIP=$(sudo cat /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml | grep 'name="listen-ip"' | cut -d\" -f4 | awk '{print $1}')
2010-08-26 01:53:25 +08:00
2010-10-10 04:39:06 +08:00
sudo sed -i "s/asterisk.application[ ]*=.*/asterisk.application=meetme/g" \
$RED5_DIR/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
2009-12-12 05:20:34 +08:00
2010-01-21 04:53:47 +08:00
#
# update /etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/^exten => _XXXX.,n,Konference(\${EXTEN},H)/; exten => _XXXX.,n,Konference(\${EXTEN},H)/g" \
2010-01-21 04:53:47 +08:00
/etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/;[ ]*exten => _XXXX.,n,MeetMe(\${EXTEN},cdMsT)/exten => _XXXX.,n,MeetMe(\${EXTEN},cdMsT)/g" \
2010-01-21 04:53:47 +08:00
/etc/asterisk/bbb_extensions.conf
2009-12-12 05:20:34 +08:00
2010-01-16 22:28:53 +08:00
#
# update /etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/; exten => _XXXX.,n,MeetMe(\${CONFERENCE_FOUND},cdMsT)/exten => _XXXX.,n,MeetMe(\${CONFERENCE_FOUND},cdMsT)/g" \
2009-12-12 05:20:34 +08:00
/etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/^exten => _XXXX.,n,Konference(\${CONFERENCE_FOUND},H)/; exten => _XXXX.,n,Konference(\${CONFERENCE_FOUND},H)/g" \
2009-12-12 05:20:34 +08:00
/etc/asterisk/bbb_extensions.conf
2010-08-23 21:49:54 +08:00
echo "Switching to $CONFERENCE ... "
2011-05-28 06:54:09 +08:00
if [ -f $FREESWITCH_INIT_D ]; then
sudo $FREESWITCH_INIT_D stop
2010-10-17 09:27:12 +08:00
sudo update-rc.d -f freeswitch remove >/dev/null
fi
2010-10-08 02:56:33 +08:00
2013-02-04 06:08:38 +08:00
change_var_ip /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties bbb.sip.server.ip 127.0.0.1
2010-11-04 08:48:04 +08:00
2010-10-08 02:56:33 +08:00
sudo update-rc.d asterisk defaults 21 > /dev/null
2010-08-23 21:49:54 +08:00
sudo /etc/init.d/asterisk restart
sudo /etc/init.d/red5 restart
2009-12-12 05:20:34 +08:00
fi
2012-02-23 06:33:22 +08:00
#
# Depreciated
#
2010-10-10 04:39:06 +08:00
if [ $CONFERENCE = "app_konference" ]; then
2010-10-17 09:27:12 +08:00
if [ ! -f /etc/asterisk/bbb_extensions.conf ]; then
2010-10-31 07:45:50 +08:00
echo
echo "# Unable to find /etc/asterisk/bbb_extensions.conf"
echo "# To install asterisk for BigBlueButton, try"
echo "# sudo apt-get install bbb-voice-conference"
2010-10-17 09:27:12 +08:00
exit 1
fi
2010-01-16 22:28:53 +08:00
#
2010-07-07 22:57:20 +08:00
# update $RED5_DIR/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
2010-01-16 22:28:53 +08:00
#
2010-09-20 09:47:17 +08:00
# EVENTIP=$(cat /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml | grep 'name="listen-ip"' | cut -d\" -f4 | awk '{print $1}')
# sed -i 's/$EVENTIP/$HOST/g' \
# /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml
2010-08-26 01:53:25 +08:00
2010-01-16 22:28:53 +08:00
sudo sed -i "s/asterisk.application[ ]*=.*/asterisk.application=konference/g" \
2010-07-07 22:57:20 +08:00
$RED5_DIR/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
2009-12-12 05:20:34 +08:00
2010-01-21 04:53:47 +08:00
#
# update /etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/;[ ]*exten => _XXXX.,n,Konference(\${EXTEN},H)/exten => _XXXX.,n,Konference(\${EXTEN},H)/g" \
2010-01-21 04:53:47 +08:00
/etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/^exten => _XXXX.,n,MeetMe(\${EXTEN},cdMsT)/; exten => _XXXX.,n,MeetMe(\${EXTEN},cdMsT)/g" \
2010-01-21 04:53:47 +08:00
/etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/^exten => _XXXX.,n,MeetMe(\${CONFERENCE_FOUND},cdMsT)/; exten => _XXXX.,n,MeetMe(\${CONFERENCE_FOUND},cdMsT)/g" \
2009-12-12 05:20:34 +08:00
/etc/asterisk/bbb_extensions.conf
2010-07-01 03:50:31 +08:00
sudo sed -i "s/; exten => _XXXX.,n,Konference(\${CONFERENCE_FOUND},H)/exten => _XXXX.,n,Konference(\${CONFERENCE_FOUND},H)/g" \
2009-12-12 05:20:34 +08:00
/etc/asterisk/bbb_extensions.conf
2010-08-23 21:49:54 +08:00
if [ -f /usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml ]; then
sudo sed -i 's/<import resource="bbb-voice-freeswitch.xml"\(.*\)\/>/<import resource="bbb-voice-asterisk.xml"\1\/>/g' \
/usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml
fi
2013-02-04 06:08:38 +08:00
change_var_ip /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties bbb.sip.server.ip 127.0.0.1
2010-11-04 08:48:04 +08:00
2010-08-23 21:49:54 +08:00
echo "Switching to $CONFERENCE ... "
2011-05-28 06:54:09 +08:00
if [ -f $FREESWITCH_INIT_D ]; then
sudo $FREESWITCH_INIT_D stop
2010-10-17 09:27:12 +08:00
sudo update-rc.d -f freeswitch remove >/dev/null
fi
2010-09-20 09:47:17 +08:00
2010-10-10 04:39:06 +08:00
sudo update-rc.d asterisk defaults 21 > /dev/null
2010-10-08 02:56:33 +08:00
2010-10-10 04:39:06 +08:00
sudo /etc/init.d/asterisk restart
sudo /etc/init.d/red5 restart
2009-12-12 05:20:34 +08:00
fi
2010-08-23 21:49:54 +08:00
if [ $CONFERENCE = "freeswitch" ]; then
# check if freeswitch is installed
if [ ! -d /opt/freeswitch ]; then
2010-10-31 07:45:50 +08:00
echo
echo "# Unable to switch to FreeSWTICH as it does not appear to be installed."
echo "# Try"
echo "# sudo apt-get install bbb-freeswitch-config"
echo
2010-08-23 21:49:54 +08:00
exit 1;
fi
# switch the red5-web.xml from asterisk to freeswitch
if [ -f /usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml ]; then
sudo sed -i 's/<import resource="bbb-voice-asterisk.xml"\(.*\)\/>/<import resource="bbb-voice-freeswitch.xml"\1\/>/g' \
/usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml
fi
2013-02-04 06:08:38 +08:00
change_var_ip /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties bbb.sip.server.ip 127.0.0.1
2010-08-23 21:49:54 +08:00
echo "Switching to $CONFERENCE ... "
2010-10-17 09:27:12 +08:00
if [ -f /etc/init.d/asterisk ]; then
sudo /etc/init.d/asterisk stop
sudo update-rc.d -f asterisk remove >/dev/null
fi
2010-09-20 09:47:17 +08:00
update-rc.d freeswitch defaults >/dev/null
2010-10-08 02:56:33 +08:00
2011-05-28 06:54:09 +08:00
sudo $FREESWITCH_INIT_D start
2010-08-23 21:49:54 +08:00
sudo /etc/init.d/red5 restart
fi
2009-12-12 05:20:34 +08:00
fi
2010-03-25 21:55:39 +08:00
if [ $RESTART ]; then
need_root
2010-10-31 05:41:21 +08:00
check_configuration
2010-03-25 21:55:39 +08:00
echo "Restarting BigBlueButton ..."
stop_bigbluebutton
echo
display_bigbluebutton_status
echo
start_bigbluebutton
2010-10-31 05:41:21 +08:00
check_state
2010-03-25 21:55:39 +08:00
fi
2009-12-13 01:56:14 +08:00
if [ $CLEAN ]; then
need_root
2010-10-31 05:41:21 +08:00
check_configuration
2010-03-09 23:32:20 +08:00
2012-08-19 06:33:37 +08:00
echo "Doing a restart of BigBlueButton and cleaning out all log files..."
2009-12-13 22:34:01 +08:00
2010-03-25 21:55:39 +08:00
stop_bigbluebutton
2009-12-13 01:56:14 +08:00
#
# Clean log files
#
echo
2010-01-06 07:57:22 +08:00
echo "Cleaning Log Files ..."
2009-12-13 22:42:44 +08:00
rm -f /var/log/asterisk/event*
rm -f /var/log/asterisk/messages*
rm -f /var/log/asterisk/queue*
2010-09-15 23:02:41 +08:00
rm -f /var/log/bigbluebutton/bbb-web.log*
2012-05-04 11:17:58 +08:00
rm -f /var/log/bigbluebutton/*.log
2011-08-26 06:47:03 +08:00
#
# Clean out the log files for record and playback
#
rm -f /var/log/bigbluebutton/bbb-rap-worker.log*
rm -f /var/log/bigbluebutton/archive.log*
if [ -d /var/log/bigbluebutton/slides ]; then
rm -f /var/log/bigbluebutton/slides/*
fi
2010-03-09 23:32:20 +08:00
2010-07-07 22:57:20 +08:00
if [ $RED5_DIR ]; then
rm -rf $RED5_DIR/log/*
2010-03-09 23:32:20 +08:00
fi
2010-12-13 09:12:22 +08:00
if [ $SERVLET_LOGS ]; then
rm -rf $SERVLET_LOGS/*
2010-03-09 23:32:20 +08:00
fi
2009-12-13 01:56:14 +08:00
rm -rf /var/log/nginx/*
2009-12-20 07:33:29 +08:00
mv /var/log/syslog /tmp/syslog.$$
echo "" > /var/log/syslog
2009-12-13 01:56:14 +08:00
2010-03-25 21:55:39 +08:00
display_bigbluebutton_status
2009-12-14 02:11:05 +08:00
2010-10-08 02:56:33 +08:00
echo ""
2010-03-25 21:55:39 +08:00
start_bigbluebutton
2010-10-31 05:41:21 +08:00
check_state
2009-12-13 01:56:14 +08:00
fi
2009-12-13 22:34:01 +08:00
if [ $NETWORK ]; then
2009-12-14 02:11:05 +08:00
netstat -ant | egrep ":1935|:9123|:80\ " | egrep -v ":::|0.0.0.0" > /tmp/t_net
2009-12-13 22:34:01 +08:00
REMOTE=$(cat /tmp/t_net | cut -c 45-68 | cut -d ":" -f1 | sort | uniq)
if [ "$REMOTE" != "" ]; then
2009-12-14 02:11:05 +08:00
echo -e "netstat\t\t\t80\t1935\t9123"
2009-12-13 22:34:01 +08:00
for IP in $REMOTE ; do
2009-12-14 02:11:05 +08:00
PORT_1935=$(cat /tmp/t_net | grep :1935 | cut -c 45-68 | cut -d ":" -f1 | grep $IP | wc -l)
PORT_9123=$(cat /tmp/t_net | grep :9123 | cut -c 45-68 | cut -d ":" -f1 | grep $IP | wc -l )
PORT_80=$(cat /tmp/t_net | grep :80 | cut -c 45-68 | cut -d ":" -f1 | grep $IP | wc -l )
2010-10-10 04:39:06 +08:00
echo -e "$IP\t\t$PORT_80\t$PORT_1935\t$PORT_9123"
2009-12-13 22:34:01 +08:00
done
fi
fi
2009-12-13 01:56:14 +08:00
if [ $WATCH ]; then
need_root
2010-10-31 08:28:27 +08:00
if [ $VOICE_CONFERENCE == "bbb-voice-asterisk.xml" ]; then
watch -n 2 "top -n 1 -b | head -n 5; echo; asterisk -r -x \"core show channels\"; echo; bbb-conf --network; bbb-conf --debug"
else
watch -n 2 "top -n 1 -b | head -n 5; echo; bbb-conf --network; bbb-conf --debug"
fi
2009-12-13 01:56:14 +08:00
fi
2010-09-20 09:47:17 +08:00