SAAS-83: Add ability to install Airtime components separately

-moving along...
This commit is contained in:
Martin Konecny 2011-11-26 00:57:14 -05:00
parent b16fa16042
commit 3a39aacd85
6 changed files with 33 additions and 30 deletions

View file

@ -7,9 +7,7 @@ if [ `whoami` != 'root' ]; then
exit 1
fi
export INSTALL_PYPO=1
export INSTALL_MEDIA_MONITOR=1
export INSTALL_SHOW_RECORDER=1
export WEB_ONLY=0
set +e
DEB=$(dpkg -s airtime 2> /dev/null | grep Status)
@ -30,6 +28,7 @@ set +e
DO_UPGRADE="0"
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-installed-check.php $@
result=$?
set -e
if [ "$result" -eq "1" ]; then
DO_UPGRADE="1"
@ -37,6 +36,8 @@ elif [ "$result" -eq "2" -o "$result" -eq "3" ]; then
exit 1
elif [ "$result" -eq "4" ]; then
exit 0
elif [ "$result" -eq "5" ]; then
WEB_ONLY=1
fi
#make DO_UPGRADE available in sub bash scripts

View file

@ -487,7 +487,8 @@ class AirtimeInstall
'overwrite|o' => 'Overwrite any existing config files.',
'preserve|p' => 'Keep any existing config files.',
'no-db|n' => 'Turn off database install.',
'reinstall|r' => 'Force a fresh install of this Airtime Version'
'reinstall|r' => 'Force a fresh install of this Airtime Version',
'webonly|w' => 'Install only web files'
)
);
$opts->parse();

View file

@ -56,19 +56,13 @@ echo "$MIN $HOUR * * * root /usr/lib/airtime/utils/phone_home_stat" > /etc/cron.
echo "* Creating /usr/lib/airtime"
if [ "$INSTALL_PYPO" -eq "1" -o "$INSTALL_MEDIA_MONITOR" -eq "1" -o "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
if [ "$WEB_ONLY" -eq "0" ]; then
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_install.py
fi
if [ "$INSTALL_PYPO" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/pypo/install/pypo-copy-files.py
fi
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-copy-files.py
fi
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-copy-files.py
fi
cp -R $AIRTIMEROOT/utils /usr/lib/airtime
echo "* Creating symbolic links in /usr/bin"

View file

@ -30,13 +30,9 @@ if [ "$DO_UPGRADE" -eq "0" ]; then
fi
set -e
if [ "$INSTALL_PYPO" -eq "1" ]; then
if [ "$WEB_ONLY" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/pypo/install/pypo-initialize.py
fi
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-initialize.py
fi
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-initialize.py
fi
@ -51,14 +47,10 @@ fi
sleep 1
set +e
if [ "$INSTALL_PYPO" -eq "1" ]; then
if [ "$WEB_ONLY" -eq "0" ]; then
monit monitor airtime-playout
monit monitor airtime-liquidsoap
fi
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
monit monitor airtime-media-monitor
fi
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
monit monitor airtime-show-recorder
fi

View file

@ -13,6 +13,7 @@
* Returns 2 if the same version of Airtime is installed
* Returns 3 if a version of Airtime that we can't upgrade from is installed.
* Returns 4 if we need to print help message.
* Returns 5 if we need should only install apache files (web-only).
*/
require_once(dirname(__FILE__).'/AirtimeInstall.php');
require_once(__DIR__.'/airtime-constants.php');
@ -20,8 +21,9 @@ require_once(__DIR__.'/airtime-constants.php');
AirtimeInstall::ExitIfNotRoot();
$opts = AirtimeInstall::getOpts();
if ($opts == NULL) {
exit(4);
if (is_null($opts)) {
exit(0);
}
if (isset($opts->h)) {
@ -29,6 +31,11 @@ if (isset($opts->h)) {
exit(4);
}
//install media-monitor
if (isset($opts->w)){
exit(5);
}
$version = AirtimeInstall::GetVersionInstalled();
// The current version is already installed.
echo "* Checking for existing install of Airtime...".PHP_EOL;

View file

@ -127,11 +127,19 @@ class AirtimeCheck {
$data = $p_status->status;
self::output_status("KERNEL_VERSION", $data->platform->release);
self::output_status("MACHINE_ARCHITECTURE", $data->platform->machine);
self::output_status("TOTAL_MEMORY_MBYTES", $data->platform->memory);
self::output_status("TOTAL_SWAP_MBYTES", $data->platform->swap);
self::output_status("AIRTIME_VERSION", $data->airtime_version);
if ($data->platform){
self::output_status("KERNEL_VERSION", $data->platform->release);
self::output_status("MACHINE_ARCHITECTURE", $data->platform->machine);
self::output_status("TOTAL_MEMORY_MBYTES", $data->platform->memory);
self::output_status("TOTAL_SWAP_MBYTES", $data->platform->swap);
self::output_status("AIRTIME_VERSION", $data->airtime_version);
} else {
self::output_status("KERNEL_VERSION", "UNKNOWN");
self::output_status("MACHINE_ARCHITECTURE", "UNKNOWN");
self::output_status("TOTAL_MEMORY_MBYTES", "UNKNOWN");
self::output_status("TOTAL_SWAP_MBYTES", "UNKNOWN");
self::output_status("AIRTIME_VERSION", "UNKNOWN");
}
self::output_status("OS", self::CheckOsTypeVersion());
self::output_status("CPU", self::GetCpuInfo());
self::output_status("WEB_SERVER", self::GetServerType());