' . $output . ' -- '; - break; - } - - // Info on devices - case 'info': - { - $type = $_POST['type']; - 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 "
$output"; - break; - } - - // 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 "
$output"; - break; - } - - // Abort tests - case 'abort': - { - $output = shell_exec($smartctl . " -X /dev/" . escapeshellarg($targetdev)); - echo "
$output"; - break; - } - - // Default page, prints the forms to view info, test, etc... - default: - { - - // Get all AD* and DA* (IDE and SCSI) devices currently installed and stores them in the $devs array - exec("ls /dev | grep '^\(ad\|da\|ada\)[0-9]\{1,2\}$'", $devs); - ?> - -
-" . $ulmsg . "\n"; ?> - - -