' . $output . ''; break; } // Info on devices case 'info': { $type = $_POST['type']; $output = add_colors(shell_exec($smartctl . " -" . $type . " /dev/" . $_POST['device'])); echo "
$output"; break; } // View logs case 'logs': { $type = $_POST['type']; $output = add_colors(shell_exec($smartctl . " -l " . $type . " /dev/" . $_POST['device'])); echo "
$output"; break; } // Abort tests case 'abort': { $output = shell_exec($smartctl . " -X /dev/" . $_POST['device']); echo "
$output"; break; } // 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']); $savemsg = "Email sent to " . $config['system']['smartmonemail']; smartmonctl("stop"); smartmonctl("start"); } else { $config['system']['smartmonemail'] = $_POST['smartmonemail']; write_config(); // Don't know what all this means, but it addes the config changed header when config is saved $retval = 0; config_lock(); if(stristr($retval, "error") <> true) $savemsg = get_std_save_message($retval); else $savemsg = $retval; config_unlock(); if($_POST['email']) { // Write the changes to the smartd.conf file update_email($_POST['smartmonemail']); } // Send sig HUP to smartd, rereads the config file shell_exec("/usr/bin/killall -HUP smartd"); } } // Was the config changed? if so , print the message if ($savemsg) print_info_box($savemsg); // Get users email from the xml file $pconfig['smartmonemail'] = $config['system']['smartmonemail']; ?>