CC-2193: Debian database install fixes

This commit is contained in:
martin 2011-04-22 00:55:31 -04:00
parent 9dc6d4c0ce
commit 6922c4d87c
1 changed files with 6 additions and 4 deletions

View File

@ -123,9 +123,9 @@ class AirtimeInstall
echo "* Creating Airtime database user".PHP_EOL;
// Create the database user
$command = "sudo -u postgres psql postgres --command \"CREATE USER {$CC_CONFIG['dsn']['username']} "
." ENCRYPTED PASSWORD '{$CC_CONFIG['dsn']['password']}' LOGIN CREATEDB NOCREATEUSER;\" 2>/dev/null";
$username = $CC_CONFIG['dsn']['username'];
$password = $CC_CONFIG['dsn']['password'];
$command = "echo \"CREATE USER $username ENCRYPTED PASSWORD '$password' LOGIN CREATEDB NOCREATEUSER;\" | sudo -u postgres psql";
@exec($command, $output, $results);
if ($results == 0) {
@ -147,7 +147,9 @@ class AirtimeInstall
echo "* Creating Airtime database".PHP_EOL;
$command = "sudo -u postgres createdb {$CC_CONFIG['dsn']['database']} --owner {$CC_CONFIG['dsn']['username']} 2> /dev/null";
$database = $CC_CONFIG['dsn']['database'];
$username = $CC_CONFIG['dsn']['username'];
$command = "echo \"CREATE DATABASE $database OWNER $username\" | sudo -u postgres psql";
@exec($command, $output, $results);
if ($results == 0) {
echo "* Database '{$CC_CONFIG['dsn']['database']}' created.".PHP_EOL;