]> oss.titaniummirror.com Git - ovzbpc.git/commitdiff
Make the scsi host the esata script attempts to add a variable defined at the
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Thu, 5 Jun 2008 22:41:19 +0000 (22:41 +0000)
committersmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Thu, 5 Jun 2008 22:41:19 +0000 (22:41 +0000)
top of the script.

esata

diff --git a/esata b/esata
index 0889d93da5be98d7d4959489d8fc40479b155a62..2f30b76cbecf2d0df7b51077c9ba677f3c2760f4 100755 (executable)
--- a/esata
+++ b/esata
@@ -3,6 +3,7 @@
 DEV=/dev/sdb2
 MNT=/media/esata
 DELAY=3
+ESATA_HOST=1
 
 registered() {
     if [ -b "$DEV" ]; then
@@ -27,7 +28,7 @@ mounted() {
 doregister() {
     registered && return 0
     [ -n "$VERBOSE" ] && echo "register SATA device"
-    scsiadd -a 1 0 0 0 >/dev/null || return 1
+    scsiadd -a $ESATA_HOST 0 0 0 >/dev/null || return 1
     sleep $DELAY
     registered || return 1
     [ -n "$VERBOSE" ] && echo "register ok"
@@ -47,7 +48,7 @@ domount() {
 dounregister() {
     registered || return 0
     [ -n "$VERBOSE" ] && echo "unregister SATA device"
-    scsiadd -r 1 0 0 0 >/dev/null || return 1
+    scsiadd -r $ESATA_HOST 0 0 0 >/dev/null || return 1
     sleep $DELAY
     registered && return 1
     [ -n "$VERBOSE" ] && echo "unregister ok"
@@ -102,7 +103,7 @@ elif [ "$1" = "status" ]; then
        echo "esata is unregistered"
     fi
     #mount | grep "$DEV"
-    #scsiadd -p | grep "scsi1"
+    #scsiadd -p | grep "scsi$ESATA_HOST"
 else
     echo "usage: $0 [-v] <mount|umount|register|status>"
 fi