summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xaddIscsiDisk9
1 files changed, 7 insertions, 2 deletions
diff --git a/addIscsiDisk b/addIscsiDisk
index 1bda195..364100b 100755
--- a/addIscsiDisk
+++ b/addIscsiDisk
@@ -1,11 +1,16 @@
#!/bin/bash
-lvname=$(basename $1)
-if [ -z "${lvname}" -o ! -b "/dev/scsiRaid/${lvname}" ]; then
+if [ -z "${lvname}" ]; then
echo "Usage: $0 <lvname>"
exit 1
fi
+lvname=$(basename $1)
+if [ ! -b "/dev/scsiRaid/${lvname}" ]; then
+ echo "Device '/dev/scsiRaid/${lvname}' not found."
+ exit 1
+fi
+
# check if disk exists in config
if grep -qs "Path=/dev/scsiRaid/${lvname},Type=diskio" /etc/iet/ietd.conf ; then
echo "Disk is already in config file. Not adding it again." >&2