fix: improve script-only install messaging and add error logging for exec() calls

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/9c87b62e-17b2-4f36-9b49-82238d73dda2

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-02 15:09:43 +00:00 committed by GitHub
parent 75e63475ae
commit 61f6e517ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 7 deletions

View file

@ -260,10 +260,16 @@ function exec_ogp_module()
else
{
// No SteamCMD installer — run pre/post install scripts only.
if (!empty((string)$precmd))
$remote->exec((string)$precmd);
if (!empty((string)$postcmd))
$remote->exec((string)$postcmd);
if (!empty((string)$precmd)) {
$result = $remote->exec((string)$precmd);
if ($result === NULL)
$db->logger("Script-only install: pre_install script returned no output for home_id $home_id");
}
if (!empty((string)$postcmd)) {
$result = $remote->exec((string)$postcmd);
if ($result === NULL)
$db->logger("Script-only install: post_install script returned no output for home_id $home_id");
}
}
echo "<h4><br><p>".get_lang('starting_installations')."</p></h4><br>";
//PANEL LOG

View file

@ -168,11 +168,20 @@ function exec_ogp_module() {
else
{
// No SteamCMD installer — run pre/post install scripts only.
if (!empty((string)$precmd))
$ran_scripts = false;
if (!empty((string)$precmd)) {
$remote->exec((string)$precmd);
if (!empty((string)$postcmd))
$ran_scripts = true;
}
if (!empty((string)$postcmd)) {
$remote->exec((string)$postcmd);
print_success( get_lang("update_started") );
$ran_scripts = true;
}
if ($ran_scripts) {
print_success( get_lang("update_started") );
} else {
print_success( get_lang("update_completed") );
}
$view->refresh("?m=gamemanager&amp;p=game_monitor&amp;home_id=$home_id", 3);
return;
}