]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/extrahd.cgi
ids.cgi: Fix downloading rules if source changed
[ipfire-2.x.git] / html / cgi-bin / extrahd.cgi
index 7cdad0161b15f7a0bc4d08d50f7781739dfdfd17..da1efb2ddff23245887643be8a3fcc60c4ae7ba0 100644 (file)
@@ -48,8 +48,13 @@ my $partitionentry = "";
 my $devicefile = "/var/ipfire/extrahd/devices";
 my $scanfile = "/var/ipfire/extrahd/scan";
 my $partitionsfile = "/var/ipfire/extrahd/partitions";
-system("/usr/local/bin/extrahdctrl scanhd ide");
-system("/usr/local/bin/extrahdctrl scanhd partitions");
+
+#workaround to suppress a warning when a variable is used only once
+my @dummy = ( ${Header::colourgreen}, ${Header::colourred} );
+undef (@dummy);
+
+system("/usr/local/bin/extrahdctrl scanhd ide >/dev/null");
+system("/usr/local/bin/extrahdctrl scanhd partitions >/dev/null");
 
 &Header::showhttpheaders();
 
@@ -127,7 +132,6 @@ if ($errormessage) {
 ############################################################################################################################
 ############################################################################################################################
 
-&Header::openbox('100%', 'center', $Lang::tr{'extrahd'});
        open( FILE, "< $devicefile" ) or die "Unable to read $devicefile";
        @devices = <FILE>;
        close FILE;
@@ -153,7 +157,7 @@ END
                                                <input type='hidden' name='FS' value='$deviceline[1]' />
                                                <input type='hidden' name='PATH' value='$deviceline[2]' />
                                                <input type='hidden' name='ACTION' value=$Lang::tr{'delete'} />
-                                               <input type='image' alt=$Lang::tr{'delete'} src='/images/delete.gif' />
+                                               <input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/delete.gif' />
                                        </form></td></tr>
 END
 ;
@@ -162,9 +166,6 @@ END
                </table>
 END
 ;
-
-&Header::closebox();
-
 &Header::openbox('100%', 'center', $Lang::tr{'extrahd detected drives'});
        print <<END
                <table border='0' width='600' cellspacing="0">
@@ -207,7 +208,7 @@ END
                foreach $partitionentry (sort @partitions)
                {
                        @partitionline = split( /\;/, $partitionentry );
-                       if (( "$partitionline[0]" =~ /^$scanline[0]/ ) && ! ( "$partitionline[0]" eq "$scanline[0]" )) {
+                       if (( "$partitionline[0]" =~ /^$scanline[0]/ ) && !( "$partitionline[2]" eq "" )) {
                                $size = int($partitionline[1] / 1024);
                                print <<END
                                <form method='post' action='$ENV{'SCRIPT_NAME'}'>
@@ -228,7 +229,7 @@ END
                                        <input type='hidden' name='DEVICE' value='$partitionline[0]' />
                                        <input type='hidden' name='UUID' value='$partitionline[2]' />
                                        <input type='hidden' name='ACTION' value=$Lang::tr{'add'} />
-                                       <input type='image' alt=$Lang::tr{'add'} src='/images/add.gif' />
+                                       <input type='image' alt='$Lang::tr{'add'}' title='$Lang::tr{'add'}' src='/images/add.gif' />
                                </form></td></tr>
 END
 ;