From d2dc2ea6a5e077c0a16f6d7b962678039bf120c8 Mon Sep 17 00:00:00 2001 From: mkonecny Date: Wed, 4 May 2011 16:27:17 -0400 Subject: [PATCH] cc-2248-uninstall-script-debian should be fixed, replaced sudo with su. Need to verify working in Debian. --- install/airtime-uninstall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/airtime-uninstall.php b/install/airtime-uninstall.php index bd95a175a..3da55df11 100644 --- a/install/airtime-uninstall.php +++ b/install/airtime-uninstall.php @@ -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;