cc-2248-uninstall-script-debian

should be fixed, replaced sudo with su. Need to verify working in Debian.
This commit is contained in:
mkonecny 2011-05-04 16:27:17 -04:00
parent 0f209d9f00
commit d2dc2ea6a5
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ AirtimeInstall::UninstallPhpCode();
// still be a connection to the database and you wont be able to delete it.
//------------------------------------------------------------------------
echo " * Dropping the database '".$CC_CONFIG['dsn']['database']."'...".PHP_EOL;
$command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']} 2> /dev/null";
$command = "su postgres -c \"dropdb {$CC_CONFIG['dsn']['database']}\"";
@exec($command, $output, $dbDeleteFailed);
//------------------------------------------------------------------------
@ -66,7 +66,7 @@ if ($dbDeleteFailed) {
// Delete the user
//------------------------------------------------------------------------
echo " * Deleting database user '{$CC_CONFIG['dsn']['username']}'...".PHP_EOL;
$command = "sudo -u postgres psql postgres --command \"DROP USER {$CC_CONFIG['dsn']['username']}\" 2> /dev/null";
$command = "echo \"DROP USER {$CC_CONFIG['dsn']['username']}\" | su postgres -c psql";
@exec($command, $output, $results);
if ($results == 0) {
echo " * User '{$CC_CONFIG['dsn']['username']}' deleted.".PHP_EOL;