Skip to content

Commit

Permalink
Fix some reboot timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
jorikfon committed Apr 14, 2024
1 parent 1e71313 commit 6112433
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/Core/System/PBXRecovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
12 changes: 6 additions & 6 deletions src/Core/System/RootFS/sbin/pbx_firmware
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...";
Expand All @@ -158,4 +153,9 @@ else
echoToTeletype " - Restoring the MikoPBX configuration settings...";
/bin/busybox cp /tmp/configbak/* /cf/conf/;
rm -rf "${img_file}";
fi
fi

echoToTeletype " - Rebooting the system..."
# Set a flag to indicate rebooting.
touch /tmp/rebooting;
exit 0;

0 comments on commit 6112433

Please sign in to comment.