]> oss.titaniummirror.com Git - ovzbpc.git/commitdiff
Change esata to use a scsi device variable.
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Thu, 23 Apr 2009 14:56:46 +0000 (14:56 +0000)
committerR. Steve McKown <rsmckown@gmail.com>
Wed, 16 Dec 2009 17:18:22 +0000 (10:18 -0700)
In the future, this script could be smarter by running scsiadd -s to scan the
scsi devices and find what we want to add.

esata

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