CC-4447: Install minimal -> reinstall uring -r reports ERROR on existing database

-fixed
This commit is contained in:
Martin Konecny 2012-09-17 16:06:16 -04:00
parent 0e82083ba1
commit f3250ac616
1 changed files with 9 additions and 0 deletions
install_minimal/include

View File

@ -215,6 +215,15 @@ 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'\";";
exec($command, $output, $rv);
if ($rv == 0) {
//database already exists
return true;
}
$command = "su postgres -c \"createdb $database --encoding UTF8 --owner $username\"";
@exec($command, $output, $results);