From 61f6e517ec08773a53db83fbb7c5163fb058160c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 2 May 2026 15:09:43 +0000 Subject: [PATCH] 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> --- modules/billing/create_servers.php | 14 ++++++++++---- modules/gamemanager/update_server.php | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/modules/billing/create_servers.php b/modules/billing/create_servers.php index 0c560fa5..ea09ff4a 100644 --- a/modules/billing/create_servers.php +++ b/modules/billing/create_servers.php @@ -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 "


".get_lang('starting_installations')."


"; //PANEL LOG diff --git a/modules/gamemanager/update_server.php b/modules/gamemanager/update_server.php index 9364e971..53a1382c 100644 --- a/modules/gamemanager/update_server.php +++ b/modules/gamemanager/update_server.php @@ -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&p=game_monitor&home_id=$home_id", 3); return; }