echo gettext("Execute");
?>
" />
				</div>
				<?php 
if ($do_action && !$errormsg) {
    echo sprintf("<div id='cmdoutput'>%s</div>", gettext("Command output:"));
    echo '<pre class="cmdoutput">';
    ob_end_flush();
    $index = array_search_ex($uuid, $config['mounts']['mount'], "uuid");
    if (false !== $index) {
        $mount = $config['mounts']['mount'][$index];
        switch ($action) {
            case "mount":
                echo gettext("Mounting...") . "<br />";
                $result = disks_mount($mount);
                break;
            case "umount":
                echo gettext("Unmounting...") . "<br />";
                $result = disks_umount($mount);
                break;
        }
        echo 0 == $result ? gettext("Done.") : gettext("Failed.");
    }
    echo '</pre>';
}
?>
				<div id="remarks">
					<?php 
html_remark("note", gettext("Note"), gettext("You can't unmount a drive which is used by swap file, a iSCSI-target file or any other running process!"));
?>
Example #2
0
function mountmanagement_process_updatenotification($mode, $data)
{
    global $config;
    if (!is_array($config['mounts']['mount'])) {
        return 1;
    }
    $index = array_search_ex($data, $config['mounts']['mount'], "uuid");
    if (false === $index) {
        return 1;
    }
    switch ($mode) {
        case UPDATENOTIFY_MODE_NEW:
            disks_mount($config['mounts']['mount'][$index]);
            break;
        case UPDATENOTIFY_MODE_MODIFIED:
            disks_umount_ex($config['mounts']['mount'][$index]);
            disks_mount($config['mounts']['mount'][$index]);
            break;
        case UPDATENOTIFY_MODE_DIRTY:
            disks_umount($config['mounts']['mount'][$index]);
            unset($config['mounts']['mount'][$index]);
            write_config();
            break;
    }
}
Example #3
0
echo gettext("Execute");
?>
" />
				</div>
				<?php 
if ($pconfig['do_action']) {
    echo sprintf("<div id='cmdoutput'>%s</div>", gettext("Command output:"));
    echo '<pre class="cmdoutput">';
    //ob_end_flush();
    switch ($pconfig['action']) {
        case "attach":
            $result = disks_geli_attach($geli['device'][0], $pconfig['passphrase'], true);
            // When attaching the disk, then also mount it.
            if (FALSE !== ($cnid = array_search_ex($geli['devicespecialfile'], $a_mount, "mdisk"))) {
                echo "<br />" . gettext("Mounting device.") . "<br />";
                echo 0 == disks_mount($a_mount[$cnid]) ? gettext("Successful.") : gettext("Failed.");
            }
            break;
        case "detach":
            $result = disks_geli_detach($geli['devicespecialfile'], true);
            echo 0 == $result ? gettext("Done.") : gettext("Failed.");
            break;
        case "setkey":
            disks_geli_setkey($geli['devicespecialfile'], $pconfig['oldpassphrase'], $pconfig['passphrase'], true);
            break;
        case "list":
            system("/sbin/geli list");
            break;
        case "status":
            system("/sbin/geli status");
            break;
Example #4
0
        }
    }
}
if ($_GET['act'] == "del") {
    if ($a_mount[$_GET['id']]) {
        disks_umount_adv($a_mount[$_GET['id']]);
        unset($a_mount[$_GET['id']]);
        write_config();
        touch($d_mountdirty_path);
        pfSenseHeader("disks_mount.php");
        exit;
    }
}
if ($_GET['act'] == "ret") {
    if ($a_mount[$_GET['id']]) {
        disks_mount($a_mount[$_GET['id']]);
        pfSenseHeader("disks_mount.php");
        exit;
    }
}
include "head.inc";
/* put your custom HTML head content here        */
/* using some of the $pfSenseHead function calls */
echo $pfSenseHead->getHTML();
?>

<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?php 
echo $jsevents["body"]["onload"];
?>
">
<?php