Merge pull request #1842 from nextcloud/oc_26372

console.php now returns 1 instead of 0 on all errors (#26372)
This commit is contained in:
Joas Schilling 2016-10-21 10:48:59 +02:00 committed by GitHub
commit 9965a95e3b
1 changed files with 3 additions and 3 deletions

View File

@ -52,14 +52,14 @@ try {
if (!OC::$CLI) { if (!OC::$CLI) {
echo "This script can be run from the command line only" . PHP_EOL; echo "This script can be run from the command line only" . PHP_EOL;
exit(0); exit(1);
} }
set_exception_handler('exceptionHandler'); set_exception_handler('exceptionHandler');
if (!function_exists('posix_getuid')) { if (!function_exists('posix_getuid')) {
echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL; 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()); $user = posix_getpwuid(posix_getuid());
$configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php')); $configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
@ -68,7 +68,7 @@ try {
echo "Current user: " . $user['name'] . PHP_EOL; echo "Current user: " . $user['name'] . PHP_EOL;
echo "Owner of config.php: " . $configUser['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; 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(); $oldWorkingDir = getcwd();