Fixed hardcoded database name in AirtimeInstall.php
This commit is contained in:
parent
5d2aae4525
commit
25be2fc3ff
1 changed files with 6 additions and 3 deletions
|
@ -118,6 +118,7 @@ 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
|
||||
|
@ -216,11 +217,13 @@ class AirtimeInstall
|
|||
$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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue