Example #1
0
$pgtitle = array(gettext("Diagnostics"), gettext("NanoBSD"));
include "head.inc";
// Survey slice info
global $SLICE, $OLDSLICE, $TOFLASH, $COMPLETE_PATH, $COMPLETE_BOOT_PATH;
global $GLABEL_SLICE, $UFS_ID, $OLD_UFS_ID, $BOOTFLASH;
global $BOOT_DEVICE, $REAL_BOOT_DEVICE, $BOOT_DRIVE, $ACTIVE_SLICE;
nanobsd_detect_slice_info();
$NANOBSD_SIZE = nanobsd_get_size();
$class = 'alert-warning';
if ($_POST['bootslice']) {
    if (!DEBUG) {
        nanobsd_switch_boot_slice();
    } else {
        sleep(4);
    }
    $savemsg = sprintf(gettext("The boot slice has been set to %s"), nanobsd_get_active_slice());
    $class = 'alert-success';
    // Survey slice info
    nanobsd_detect_slice_info();
}
if ($_POST['destslice'] && $_POST['duplicateslice']) {
    $statusmsg = gettext("Duplicating slice.  Please wait, this will take a moment...");
    if (!DEBUG && nanobsd_clone_slice($_POST['destslice'])) {
        $savemsg = gettext("The slice has been duplicated.") . "<p/>" . gettext("If you would like to boot from this newly duplicated slice please set it using the bootup information area.");
        $class = 'alert-success';
    } else {
        $savemsg = gettext("There was an error while duplicating the slice.\t Operation aborted.");
        $class = 'alert-danger';
    }
    // Re-Survey slice info
    nanobsd_detect_slice_info();
Example #2
0
include "fbegin.inc";
?>

<?php 
$NANOBSD_SIZE = nanobsd_get_size();
if ($_POST['bootslice']) {
    $statusmsg = gettext("Setting slice information, please wait...");
    echo <<<EOF
\t \t<div id="loading">
\t\t\t<img src="/themes/{$g['theme']}/images/misc/loader.gif"> 
\t\t\t{$statusmsg}
\t\t\t<p/>&nbsp;
\t\t</div>
EOF;
    nanobsd_switch_boot_slice();
    $savemsg = gettext("The boot slice has been set to") . " " . nanobsd_get_active_slice();
    // Survey slice info
    nanobsd_detect_slice_info();
}
if ($_POST['destslice']) {
    $statusmsg = gettext("Duplicating slice.  Please wait, this will take a moment...");
    echo <<<EOF
 \t<div id="loading">
\t\t<img src="/themes/{$g['theme']}/images/misc/loader.gif">
\t\t{$statusmsg}
\t\t<p/>&nbsp;
\t</div>
EOF;
    if (nanobsd_clone_slice($_POST['destslice'])) {
        $savemsg = gettext("The slice has been duplicated.") . "<p/>" . gettext("If you would like to boot from this newly duplicated slice please set it using the bootup information area.");
    } else {