From 25be2fc3ff8900ac7e85165105fabb2842ebb52a Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 23 Jan 2014 13:10:13 -0500 Subject: [PATCH] Fixed hardcoded database name in AirtimeInstall.php --- install_minimal/include/AirtimeInstall.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index ac44297bd..fccec52b6 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -117,7 +117,8 @@ class AirtimeInstall { AirtimeInstall::InstallQuery("DROP SEQUENCE IF EXISTS $p_sequenceName", false); } - + + /** * Try to connect to the database. Return true on success, false on failure. * @param boolean $p_exitOnError @@ -215,12 +216,14 @@ class AirtimeInstall $database = $CC_CONFIG['dsn']['database']; $username = $CC_CONFIG['dsn']['username']; #$command = "echo \"CREATE DATABASE $database OWNER $username\" | su postgres -c psql 2>/dev/null"; - - $command = "su postgres -c \"psql -l | cut -f2 -d' ' | grep -w 'airtime'\";"; + + echo $database . PHP_EOL; + $command = "su postgres -c \"psql -l | cut -f2 -d' ' | grep -w '{$database}'\";"; exec($command, $output, $rv); if ($rv == 0) { //database already exists + echo "Database already exists." . PHP_EOL; return true; }