libretime/install_minimal/airtime-install

40 lines
1.2 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, e.g. /home/user/bin/foo.sh
SCRIPT=`readlink -f $0`
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=`dirname $SCRIPT`
AIRTIMEROOT=$SCRIPTPATH/../
rm -rf "/usr/lib/airtime"
$AIRTIMEROOT/python_apps/python-virtualenv/virtualenv-install.sh
python $AIRTIMEROOT/python_apps/create-pypo-user.py
$SCRIPTPATH/include/airtime-copy-files.sh
$SCRIPTPATH/include/airtime-initialize.sh $@
/usr/lib/airtime/utils/rabbitmq-update-pid.sh
echo -e "\n*** Verifying your system environment, running airtime-check-system ***"
sleep 10
airtime-check-system
echo -e "\n******************************* Install Complete *******************************"