diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index e4ab44793..a3f5a68df 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -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 diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index 07602939c..ae6f9ce2c 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -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(); diff --git a/install_minimal/include/airtime-copy-files.sh b/install_minimal/include/airtime-copy-files.sh index 43349a7d9..1cdb4a264 100755 --- a/install_minimal/include/airtime-copy-files.sh +++ b/install_minimal/include/airtime-copy-files.sh @@ -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" diff --git a/install_minimal/include/airtime-initialize.sh b/install_minimal/include/airtime-initialize.sh index 5856c805f..b571e1f39 100755 --- a/install_minimal/include/airtime-initialize.sh +++ b/install_minimal/include/airtime-initialize.sh @@ -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 diff --git a/install_minimal/include/airtime-installed-check.php b/install_minimal/include/airtime-installed-check.php index b9b9bd758..5bb6a1f31 100644 --- a/install_minimal/include/airtime-installed-check.php +++ b/install_minimal/include/airtime-installed-check.php @@ -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; diff --git a/utils/airtime-check-system.php b/utils/airtime-check-system.php index 562a87fc7..5bde7273b 100644 --- a/utils/airtime-check-system.php +++ b/utils/airtime-check-system.php @@ -126,12 +126,20 @@ class AirtimeCheck { $p_status = json_decode($p_status); $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());