Force the <enableserial> on when restoring a backup on a device with serial only console.

Affects multiple devices.

Ticket #1547

(cherry picked from commit c91af4ac6a)
This commit is contained in:
Luiz Souza 2019-02-12 20:48:15 -02:00 committed by jim-p
parent b473b576ef
commit be8a5a8a71

View File

@ -328,7 +328,8 @@ if ($_POST) {
if (file_exists("/boot/loader.conf")) {
$loaderconf = file_get_contents("/boot/loader.conf");
if (strpos($loaderconf, "console=\"comconsole")) {
if (strpos($loaderconf, "console=\"comconsole") ||
strpos($loaderconf, "boot_serial=\"YES") {
$config['system']['enableserial'] = true;
write_config(gettext("Restore serial console enabling in configuration."));
}
@ -336,7 +337,8 @@ if ($_POST) {
}
if (file_exists("/boot/loader.conf.local")) {
$loaderconf = file_get_contents("/boot/loader.conf.local");
if (strpos($loaderconf, "console=\"comconsole")) {
if (strpos($loaderconf, "console=\"comconsole") ||
strpos($loaderconf, "boot_serial=\"YES") {
$config['system']['enableserial'] = true;
write_config(gettext("Restore serial console enabling in configuration."));
}