sintonia/install_minimal/airtime-install
Yuchen Wang db82e51c30 CC-3048: Install_minimal should check much sooner if Airtime is already installed
- fixed by creating new php file airtime-installed-check, which checks whether current version
of airtime exists; this file gets called right after root user check and whether debian
package exists check
- moved some code from airtime-install.php to AirtimeInstall.php as static functions
so that we reduce duplicated code
- both the new file airtime-installed-check.php and airtime-install.php use the new
static functions created above
2011-11-18 14:06:42 -05:00

42 lines
1.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
# 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/../
# Check if airtime exists already
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-installed-check.php $@
echo -e "\n******************************** Install Begin *********************************"
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 *******************************"