79 lines
2.3 KiB
Bash
Executable File
79 lines
2.3 KiB
Bash
Executable File
#!/bin/bash -e
|
|
#-e Causes bash script to exit if any of the installers
|
|
#return with a non-zero return value.
|
|
|
|
if [ `whoami` != 'root' ]; then
|
|
echo "Please run as root user."
|
|
exit 1
|
|
fi
|
|
|
|
set +e
|
|
DEB=$(dpkg -s airtime 2> /dev/null | grep Status)
|
|
set -e
|
|
if [[ "$DEB" = "Status: install ok installed" ]]; then
|
|
echo -e "\nDebian package of Airtime detected. Please use the debian package to upgrade.\n"
|
|
exit 1
|
|
fi
|
|
|
|
echo -e "\n******************************** Install Begin *********************************"
|
|
|
|
# Absolute path to this script
|
|
SCRIPT=`readlink -f $0`
|
|
# Absolute directory this script is in
|
|
SCRIPTPATH=`dirname $SCRIPT`
|
|
|
|
${SCRIPTPATH}/../python_apps/python-virtualenv/virtualenv-install.sh
|
|
|
|
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
|
. ${virtualenv_bin}activate
|
|
|
|
echo -e "\n*** Creating Pypo User ***"
|
|
python ${SCRIPTPATH}/../python_apps/create-pypo-user.py
|
|
|
|
set +e
|
|
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-install.php $@
|
|
result=$?
|
|
if [ "$result" -eq "2" ]; then
|
|
#We've just finished an upgrade, so let's exit
|
|
exit 0
|
|
elif [ "$result" -ne "0" ]; then
|
|
#There was an error, exit with error code.
|
|
exit 1
|
|
fi
|
|
set -e
|
|
|
|
echo -e "\n*** API Client Installation ***"
|
|
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_install.py
|
|
|
|
echo -e "\n*** Pypo Installation ***"
|
|
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-install.py
|
|
|
|
echo -e "\n*** Recorder Installation ***"
|
|
python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
|
|
|
|
echo -e "\n*** Media Monitor Installation ***"
|
|
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
|
|
|
python ${SCRIPTPATH}/../python_apps/icecast2/install/icecast2-install.py
|
|
|
|
# Need to ensure monit is running before Airtime daemons are run. This is
|
|
# so we can ensure they can register with monit to monitor them when they start.
|
|
# If monit is already running, this step is still useful as we need monit to
|
|
# reload its config files.
|
|
/etc/init.d/monit restart
|
|
|
|
|
|
set +e
|
|
monit monitor airtime-media-monitor
|
|
monit monitor airtime-liquidsoap
|
|
monit monitor airtime-playout
|
|
monit monitor airtime-show-recorder
|
|
monit monitor rabbitmq-server
|
|
set -e
|
|
|
|
echo -e "\n*** Verifying your system environment ***"
|
|
sleep 10
|
|
airtime-check-system
|
|
|
|
echo -e "\n******************************* Install Complete *******************************"
|