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:
parent
75e63475ae
commit
61f6e517ec
2 changed files with 22 additions and 7 deletions
|
|
@ -260,10 +260,16 @@ function exec_ogp_module()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// No SteamCMD installer — run pre/post install scripts only.
|
// No SteamCMD installer — run pre/post install scripts only.
|
||||||
if (!empty((string)$precmd))
|
if (!empty((string)$precmd)) {
|
||||||
$remote->exec((string)$precmd);
|
$result = $remote->exec((string)$precmd);
|
||||||
if (!empty((string)$postcmd))
|
if ($result === NULL)
|
||||||
$remote->exec((string)$postcmd);
|
$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>";
|
echo "<h4><br><p>".get_lang('starting_installations')."</p></h4><br>";
|
||||||
//PANEL LOG
|
//PANEL LOG
|
||||||
|
|
|
||||||
|
|
@ -168,11 +168,20 @@ function exec_ogp_module() {
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// No SteamCMD installer — run pre/post install scripts only.
|
// No SteamCMD installer — run pre/post install scripts only.
|
||||||
if (!empty((string)$precmd))
|
$ran_scripts = false;
|
||||||
|
if (!empty((string)$precmd)) {
|
||||||
$remote->exec((string)$precmd);
|
$remote->exec((string)$precmd);
|
||||||
if (!empty((string)$postcmd))
|
$ran_scripts = true;
|
||||||
|
}
|
||||||
|
if (!empty((string)$postcmd)) {
|
||||||
$remote->exec((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);
|
$view->refresh("?m=gamemanager&p=game_monitor&home_id=$home_id", 3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue