Example #1
0
     if (!in_array($type, $valid_info_types)) {
         echo "Invalid info type, bailing.";
         return;
     }
     $output = add_colors(shell_exec($smartctl . " -" . escapeshellarg($type) . " /dev/" . escapeshellarg($targetdev)));
     echo "<pre>{$output}</pre>";
     break;
     // View logs
 // View logs
 case 'logs':
     $type = $_POST['type'];
     if (!in_array($type, $valid_log_types)) {
         echo "Invalid log type, bailing.";
         return;
     }
     $output = add_colors(shell_exec($smartctl . " -l " . escapeshellarg($type) . " /dev/" . escapeshellarg($targetdev)));
     echo "<pre>{$output}</pre>";
     break;
     // Abort tests
 // Abort tests
 case 'abort':
     $output = shell_exec($smartctl . " -X /dev/" . escapeshellarg($targetdev));
     echo "<pre>{$output}</pre>";
     break;
     // Config changes, users email in xml config and write changes to smartd.conf
 // Config changes, users email in xml config and write changes to smartd.conf
 case 'config':
     if (isset($_POST['submit'])) {
         // DOES NOT WORK YET...
         if ($_POST['testemail']) {
             // FIXME				shell_exec($smartd . " -M test -m " . $config['system']['smartmonemail']);
Example #2
0
		<input type="submit" name="submit" value="' . gettext("Abort") . '" />
		</form>
		</pre>';
        break;
        // Info on devices
    // Info on devices
    case 'info':
        $type = $_POST['type'];
        $output = add_colors(shell_exec($smartctl . " -" . $type . " /dev/" . $_POST['device']));
        echo "<pre>{$output}</pre>";
        break;
        // View logs
    // View logs
    case 'logs':
        $type = $_POST['type'];
        $output = add_colors(shell_exec($smartctl . " -l " . $type . " /dev/" . $_POST['device']));
        echo "<pre>{$output}</pre>";
        break;
        // Abort tests
    // Abort tests
    case 'abort':
        $output = shell_exec($smartctl . " -X /dev/" . $_POST['device']);
        echo "<pre>{$output}</pre>";
        break;
        // Config changes, users email in xml config and write changes to smartd.conf
    // Config changes, users email in xml config and write changes to smartd.conf
    case 'config':
        if (isset($_POST['submit'])) {
            // DOES NOT WORK YET...
            if ($_POST['testemail']) {
                // FIXME				shell_exec($smartd . " -M test -m " . $config['system']['smartmonemail']);