From 16bc04f1207ce1152408ee5af67d1ed8dacc383d Mon Sep 17 00:00:00 2001 From: smckown Date: Thu, 23 Apr 2009 14:56:46 +0000 Subject: [PATCH] Change esata to use a scsi device variable. 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esata b/esata index 2f30b76..b10c810 100755 --- 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] " fi -- 2.39.2