@@ -126,6 +126,11 @@ function f_setup()
if [ -z "${DEVICE}" ];then
f_usage
fi
+
+ # if a symbollink is given, work out the typical device name, like /dev/sda
+ if [ -L ${DEVICE} ];then
+ DEVICE=`readlink -f ${DEVICE}`
+ fi
if [ -z "${MOUNT_POINT}" ];then
f_usage
@@ -135,6 +135,19 @@ f_setup()
f_getoptions $*
+ if [ -z ${DEVICE} ] ; then
+ ${ECHO} "ERROR: No device"
+ f_usage
+ elif [ ! -b ${DEVICE} ] ; then
+ ${ECHO} "ERROR: Invalid device ${DEVICE}"
+ exit 1
+ fi
+
+ # if a symbollink is given, work out the typical device name, like /dev/sda
+ if [ -L ${DEVICE} ];then
+ DEVICE=`readlink -f ${DEVICE}`
+ fi
+
if [ -z "${MOUNT_POINT}" ];then
f_usage
fi
@@ -1095,6 +1095,7 @@ do
?) usage;;
esac
done
+
if [ -z ${DEVICE} ] ; then
${ECHO} "ERROR: No device"
usage
@@ -1103,6 +1104,11 @@ elif [ ! -b ${DEVICE} ] ; then
exit 1
fi
+# if a symbollink is given, work out the typical device name, like /dev/sda
+if [ -L ${DEVICE} ];then
+ DEVICE=`readlink -f ${DEVICE}`
+fi
+
if [ -z ${MOUNTPOINT} ] ; then
${ECHO} "ERROR: No mountpoint"
usage
It's a usual case that the shared disk is given in symbolic name, like iscsi disk "/dev/disk/by-path/disk". So work out the typical device name in such case. Signed-off-by: Eric Ren <zren@suse.com> --- programs/discontig_bg_test/discontig_runner.sh | 5 +++++ programs/python_common/multiple_run.sh | 13 +++++++++++++ programs/python_common/single_run-WIP.sh | 6 ++++++ 3 files changed, 24 insertions(+)