Handle hostnames with upper-case letters
[webmin.git] / smart-status / action.cgi
1 #!/usr/local/bin/perl
2 # Perform some action
3
4 require './smart-status-lib.pl';
5 &ReadParse();
6 $mode = $in{'short'} ? "short" :
7         $in{'ext'} ? "ext" : "data";
8 &ui_print_header(undef, $text{$mode.'_title'}, "");
9
10 @drives = &list_smart_disks_partitions();
11 ($d) = grep { $_->{'device'} eq $in{'drive'} &&
12               $_->{'subdisk'} == $in{'subdisk'} } @drives;
13 print &text($mode."_doing", $d->{'desc'}),"\n";
14 if ($mode eq "short") {
15         ($ok, $out) = &short_test($in{'drive'}, $d);
16         }
17 elsif ($mode eq "ext") {
18         ($ok, $out) = &ext_test($in{'drive'}, $d);
19         }
20 elsif ($mode eq "data") {
21         ($ok, $out) = &data_test($in{'drive'}, $d);
22         }
23 print "<pre>$out</pre>\n";
24 if ($ok) {
25         print $text{$mode."_ok"},"<p>\n";
26         }
27 else {
28         print $text{$mode."_failed"},"<p>\n";
29         }
30
31 &ui_print_footer("index.cgi?drive=$in{'drive'}", $text{'index_return'});