umount-button.patch
· 977 B · Diff
原始檔案
--- status-usb.sh.orig 2007-02-23 20:50:16.000000000 +0100
+++ status-usb.sh 2007-02-23 23:29:16.000000000 +0100
@@ -7,6 +7,12 @@
. /usr/lib/webif/webif.sh
header "Status" "USB" "@TR<<USB Devices>>"
+if ! empty "$FORM_umount"; then
+ if ! empty "$FORM_mountpoint"; then
+ umount $FORM_mountpoint
+ fi
+fi
+
display_form <<EOF
start_form|@TR<<All connected devices (excluding system hubs)>>
EOF
@@ -55,9 +61,16 @@
<table>
<tbody>
- <tr>
- <td><pre><? mount | grep /dev/scsi/ ?></pre></td>
- </tr>
+<?
+mount | grep /dev/scsi/ | while read _dev _foo1 _mount _foo2 _foo3 _foo4; do
+ echo "<tr><td>"
+ echo "<pre>$_dev</pre></td><td><pre>$_mount</pre></td>"
+ echo "<td><form method=\"post\" action='$SCRIPT_NAME'>"
+ echo "<input type=\"submit\" value=\" @TR<<umount>> \" name=\"umount\" />"
+ echo "<input type=\"hidden\" value=\"$_mount\" name=\"mountpoint\" />"
+ echo "</form></td></tr>"
+done
+?>
</tbody>
</table>
| 1 | --- status-usb.sh.orig 2007-02-23 20:50:16.000000000 +0100 |
| 2 | +++ status-usb.sh 2007-02-23 23:29:16.000000000 +0100 |
| 3 | @@ -7,6 +7,12 @@ |
| 4 | . /usr/lib/webif/webif.sh |
| 5 | header "Status" "USB" "@TR<<USB Devices>>" |
| 6 | |
| 7 | +if ! empty "$FORM_umount"; then |
| 8 | + if ! empty "$FORM_mountpoint"; then |
| 9 | + umount $FORM_mountpoint |
| 10 | + fi |
| 11 | +fi |
| 12 | + |
| 13 | display_form <<EOF |
| 14 | start_form|@TR<<All connected devices (excluding system hubs)>> |
| 15 | EOF |
| 16 | @@ -55,9 +61,16 @@ |
| 17 | |
| 18 | <table> |
| 19 | <tbody> |
| 20 | - <tr> |
| 21 | - <td><pre><? mount | grep /dev/scsi/ ?></pre></td> |
| 22 | - </tr> |
| 23 | +<? |
| 24 | +mount | grep /dev/scsi/ | while read _dev _foo1 _mount _foo2 _foo3 _foo4; do |
| 25 | + echo "<tr><td>" |
| 26 | + echo "<pre>$_dev</pre></td><td><pre>$_mount</pre></td>" |
| 27 | + echo "<td><form method=\"post\" action='$SCRIPT_NAME'>" |
| 28 | + echo "<input type=\"submit\" value=\" @TR<<umount>> \" name=\"umount\" />" |
| 29 | + echo "<input type=\"hidden\" value=\"$_mount\" name=\"mountpoint\" />" |
| 30 | + echo "</form></td></tr>" |
| 31 | +done |
| 32 | +?> |
| 33 | |
| 34 | </tbody> |
| 35 | </table> |