From b489ccc77eae74cd24981896e32eeee260cff661 Mon Sep 17 00:00:00 2001 From: Paul Baranowski Date: Thu, 7 Apr 2011 15:47:31 -0400 Subject: [PATCH] Dont try to uninstall if the config file doesnt exist. Also fixed a bug where it checking a non-existent variable. --- install/airtime-uninstall.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install/airtime-uninstall.php b/install/airtime-uninstall.php index 7accac35f..298d3c945 100644 --- a/install/airtime-uninstall.php +++ b/install/airtime-uninstall.php @@ -9,6 +9,11 @@ require_once(dirname(__FILE__).'/include/AirtimeIni.php'); // Need to check that we are superuser before running this. AirtimeIni::ExitIfNotRoot(); +if (!file_exists('/etc/airtime/airtime.conf')) { + echo PHP_EOL."Airtime config file '/etc/airtime/airtime.conf' does not exist.".PHP_EOL; + echo "Most likely this means that Airtime is not installed, so there is nothing to do.".PHP_EOL.PHP_EOL; + exit(); +} require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/include/AirtimeInstall.php'); @@ -39,7 +44,7 @@ if ($dbDeleteFailed) { if (!PEAR::isError($CC_DBC)) { $sql = "select * from pg_tables where tableowner = 'airtime'"; $rows = $CC_DBC->GetAll($sql); - if (PEAR::isError($result)) { + if (PEAR::isError($rows)) { $rows = array(); }