Add option to specify log and bb files directory

This commit is contained in:
Yifan Liao 2017-08-31 15:42:43 -07:00
parent 1f1adb8047
commit 7d86107741

View file

@ -136,6 +136,12 @@ Options:
--notest
Needed to actually run the tests, By default $0 will just do a dry run.
--logdir
Log files directory
--bbdir
Bad blocks files directory
...
"
@ -146,7 +152,7 @@ if [[ $? -ne 4 ]]; then
fi
SHORT=h
LONG=help,notest
LONG=help,notest,logdir:,bbdir:
PARSED=$(getopt --options $SHORT --longoptions $LONG --name "$0" -- "$@")
if [[ $? -ne 0 ]]; then
@ -155,6 +161,8 @@ fi
eval set -- "$PARSED"
Log_Dir="."
BB_Dir="."
Dry_Run=1
while [ $# -gt 0 ]; do
@ -163,6 +171,14 @@ while [ $# -gt 0 ]; do
Dry_Run=0
exit 0
;;
--logdir)
Log_Dir="$2"
shift
;;
--bbdir)
BB_Dir="$2"
shift
;;
-h | --help)
echo "$USAGE"
exit 0
@ -183,12 +199,6 @@ fi
Drive=$1
# Directory specifiers for log and badblocks data files. Leave off the
# trailing slash:
Log_Dir="."
BB_Dir="."
########################################################################
#
# Prologue