diff options
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/diag_nanobsd.php | 51 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/system_information.widget.php | 3 |
2 files changed, 53 insertions, 1 deletions
diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php index 4289eda..353f9ba 100755 --- a/usr/local/www/diag_nanobsd.php +++ b/usr/local/www/diag_nanobsd.php @@ -108,6 +108,25 @@ if (isset($_POST['dhcpbackup'])) { install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}"); } +if ($_POST['changero']) { + if (is_writable("/")) { + conf_mount_ro(); + } else { + conf_mount_rw(); + } +} + +if ($_POST['setrw']) { + if (isset($_POST['nanobsd_force_rw'])) { + conf_mount_rw(); + $config['system']['nanobsd_force_rw'] = true; + } else { + unset($config['system']['nanobsd_force_rw']); + } + + write_config("Changed Permanent Read/Write Setting"); + conf_mount_ro(); +} if ($savemsg) print_info_box($savemsg) @@ -155,6 +174,38 @@ if ($savemsg) <td colspan="2" valign="top" class=""> </td> </tr> <tr> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Media Read/Write Status");?></td> + </tr> + <tr> + <td valign="top" class="vncell">Current Read/Write Status:</td> + <td valign="top" class="vncell"> + <form action="diag_nanobsd.php" method="post" name="iform"> + <?php if (is_writable("/")) { + echo gettext("Read/Write"); + if (!isset($config['system']['nanobsd_force_rw'])) + echo "<br/><input type='submit' name='changero' value='" . gettext("Switch to Read-Only") . "'>"; + } else { + echo gettext("Read-Only"); + if (!isset($config['system']['nanobsd_force_rw'])) + echo "<br/><input type='submit' name='changero' value='" . gettext("Switch to Read/Write") . "'>"; + } ?> + </form> + <br/><?php echo gettext("NOTE: This setting is only temporary, and can be switched dynamically in the background."); ?> + </td> + </tr> + <tr> + <td valign="top" class="vncell">Permanent Read/Write:</td> + <td valign="top" class="vncell"> + <form action="diag_nanobsd.php" method="post" name="iform"> + <input type="checkbox" name="nanobsd_force_rw" <?php if (isset($config['system']['nanobsd_force_rw'])) echo "checked"; ?>> <?php echo gettext("Keep media mounted read/write at all times.") ?> + <br/><input type='submit' name='setrw' value='<?php echo gettext("Save") ?>'> + </form> + </td> + </tr> + <tr> + <td colspan="2" valign="top" class=""> </td> + </tr> + <tr> <td colspan="2" valign="top" class="listtopic"><?=gettext("Duplicate bootup slice to alternate");?></td> </tr> <tr> diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 2a7055d..82f3415 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -120,11 +120,12 @@ $curcfg = $config['system']['firmware']; global $GLABEL_SLICE, $UFS_ID, $OLD_UFS_ID, $BOOTFLASH; global $BOOT_DEVICE, $REAL_BOOT_DEVICE, $BOOT_DRIVE, $ACTIVE_SLICE; nanobsd_detect_slice_info(); + $rw = is_writable("/") ? "(rw)" : "(ro)"; ?> <tr> <td width="25%" class="vncellt">NanoBSD Boot Slice</td> <td width="75%" class="listr"> - <?=htmlspecialchars(nanobsd_friendly_slice_name($BOOT_DEVICE));?> / <?=htmlspecialchars($BOOTFLASH);?> + <?=htmlspecialchars(nanobsd_friendly_slice_name($BOOT_DEVICE));?> / <?=htmlspecialchars($BOOTFLASH);?> <?php echo $rw; ?> <?php if ($BOOTFLASH != $ACTIVE_SLICE): ?> <br/><br/>Next Boot:<br/> <?=htmlspecialchars(nanobsd_friendly_slice_name($GLABEL_SLICE));?> / <?=htmlspecialchars($ACTIVE_SLICE);?> |