From 611243397a384620918d6caec69b1b13ce99c29b Mon Sep 17 00:00:00 2001 From: Nikolay Beketov Date: Mon, 15 Apr 2024 06:33:14 +0700 Subject: [PATCH] Fix some reboot timeouts --- src/Core/System/PBXRecovery.php | 6 ++---- src/Core/System/RootFS/sbin/pbx_firmware | 12 ++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Core/System/PBXRecovery.php b/src/Core/System/PBXRecovery.php index 6b9030373..a9fa04588 100644 --- a/src/Core/System/PBXRecovery.php +++ b/src/Core/System/PBXRecovery.php @@ -95,19 +95,17 @@ private function handleInput(string $input) file_put_contents('/tmp/ejectcd', ''); $installer = new PBXInstaller(); $installer->run(); - sleep(300); break; case '2': // Prepare for reinstalling file_put_contents('/tmp/ejectcd', ''); $pbx_firmwarePath = Util::which('pbx_firmware'); - Processes::mwExecBg("{$pbx_firmwarePath} /offload/firmware.img.gz {$this->DEVICE}"); - sleep(600); + Processes::mwExec("{$pbx_firmwarePath} /offload/firmware.img.gz {$this->DEVICE}"); break; case '3': // Cancel operation - sleep(2); break; } + sleep(3); } } \ No newline at end of file diff --git a/src/Core/System/RootFS/sbin/pbx_firmware b/src/Core/System/RootFS/sbin/pbx_firmware index 2ed222ec5..a6040f77a 100644 --- a/src/Core/System/RootFS/sbin/pbx_firmware +++ b/src/Core/System/RootFS/sbin/pbx_firmware @@ -144,11 +144,6 @@ if [ -f /offload/livecd ]; then echoToTeletype " - Restoring the MikoPBX default configuration ..." /bin/busybox cp -p /tmp/configbak/* /conf.recover/conf/ touch /tmp/ejectcd - - echoToTeletype " - Rebooting the system..." - # Set a flag to indicate rebooting. - touch /tmp/rebooting; - exit 0; else # Format the 3rd partition and mount it as /cf/. Then, copy the configuration back and remove the image file echoToTeletype " - Format the 3rd partition (${partition3Name}) and mount it as /cf folder ..."; @@ -158,4 +153,9 @@ else echoToTeletype " - Restoring the MikoPBX configuration settings..."; /bin/busybox cp /tmp/configbak/* /cf/conf/; rm -rf "${img_file}"; -fi \ No newline at end of file +fi + +echoToTeletype " - Rebooting the system..." + # Set a flag to indicate rebooting. +touch /tmp/rebooting; +exit 0; \ No newline at end of file