Skip to content

Commit

Permalink
Update update.php
Browse files Browse the repository at this point in the history
  • Loading branch information
rickbot-dot authored Jul 10, 2023
1 parent 7b7b7be commit ea99e89
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion maintenance/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@
echo "BUGKILLER MAINTENANCE\n\nPlease run maintenance scripts from your server's command-line shell.\nContact your administrator if you do not have access.";
exit;
}
if (PHP_SAPI != 'cli') {
if (PHP_SAPI != 'cli' and PHP_SAPI != 'cli-server') {
$runtype = PHP_SAPI;
echo "Run this script via the command-line shell. If you do not have access to your server's shell contact your server administrator. Detected PHP_SAPI: $runtype\n";
exit;
}
if (posix_getuid() !== 0 and PHP_SAPI == 'cli-server') {
echo "Please run the PHP server as root.\n";
exit;
}
if (posix_getuid() !== 0) {
echo "Please run this script as root.\n";
exit;
}
if (PHP_SAPI == 'cli-server') {
require "../updateFromCliServer.php";
exit;
}
echo "Bugkiller Server Updater\n";
echo "Attempting to update packages...\n";
chdir(dirname(__DIR__));
Expand Down

0 comments on commit ea99e89

Please sign in to comment.