-fix some minor issue when specifying airtime-install -h

This commit is contained in:
Martin Konecny 2011-11-24 17:04:24 -05:00
parent cd1e55bffc
commit e145be81de
2 changed files with 7 additions and 2 deletions

View File

@ -29,6 +29,10 @@ result=$?
set -e set -e
if [ "$result" -eq "1" ]; then if [ "$result" -eq "1" ]; then
DO_UPGRADE="1" DO_UPGRADE="1"
elif [ "$result" -eq "2" -o "$result" -eq "3" ]; then
exit 1
elif [ "$result" -eq "4" ]; then
exit 0
fi fi
#make DO_UPGRADE available in sub bash scripts #make DO_UPGRADE available in sub bash scripts

View File

@ -12,6 +12,7 @@
* Returns 1 if a previous version of Airtime installed * Returns 1 if a previous version of Airtime installed
* Returns 2 if the same version of Airtime is installed * 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 3 if a version of Airtime that we can't upgrade from is installed.
* Returns 4 if we need to print help message.
*/ */
require_once(dirname(__FILE__).'/AirtimeInstall.php'); require_once(dirname(__FILE__).'/AirtimeInstall.php');
require_once(__DIR__.'/airtime-constants.php'); require_once(__DIR__.'/airtime-constants.php');
@ -20,12 +21,12 @@ AirtimeInstall::ExitIfNotRoot();
$opts = AirtimeInstall::getOpts(); $opts = AirtimeInstall::getOpts();
if ($opts == NULL) { if ($opts == NULL) {
exit(2); exit(4);
} }
if (isset($opts->h)) { if (isset($opts->h)) {
AirtimeInstall::printUsage($opts); AirtimeInstall::printUsage($opts);
exit(2); exit(4);
} }
$version = AirtimeInstall::GetVersionInstalled(); $version = AirtimeInstall::GetVersionInstalled();