Skip to content

Commit

Permalink
Merge pull request #1842 from nextcloud/oc_26372
Browse files Browse the repository at this point in the history
console.php now returns 1 instead of 0 on all errors (#26372)
  • Loading branch information
nickvergessen authored Oct 21, 2016
2 parents 2b76d14 + 81d0c47 commit 9965a95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions console.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ function exceptionHandler($exception) {

if (!OC::$CLI) {
echo "This script can be run from the command line only" . PHP_EOL;
exit(0);
exit(1);
}

set_exception_handler('exceptionHandler');

if (!function_exists('posix_getuid')) {
echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
exit(0);
exit(1);
}
$user = posix_getpwuid(posix_getuid());
$configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
Expand All @@ -68,7 +68,7 @@ function exceptionHandler($exception) {
echo "Current user: " . $user['name'] . PHP_EOL;
echo "Owner of config.php: " . $configUser['name'] . PHP_EOL;
echo "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL;
exit(0);
exit(1);
}

$oldWorkingDir = getcwd();
Expand Down

0 comments on commit 9965a95

Please sign in to comment.