summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2010-04-07 15:16:46 +0200
committerDan Horák <dan@danny.cz>2010-04-07 15:16:46 +0200
commitf6d1d6e23c7bf5dfd8e00b9bfd32fadc88f76caf (patch)
tree5f8399e1365d964f76442f2d975f66cb2c1c60e2
parenta33811018a4e7cce2026610c5fa3938cf1ae09a1 (diff)
downloadutils-f6d1d6e23c7bf5dfd8e00b9bfd32fadc88f76caf.tar.gz
utils-f6d1d6e23c7bf5dfd8e00b9bfd32fadc88f76caf.tar.xz
utils-f6d1d6e23c7bf5dfd8e00b9bfd32fadc88f76caf.zip
allow devices to be specified on command line
Added -d|--device command line option for passing devices that needs to be unblocked.
-rw-r--r--device_cio_free11
1 files changed, 9 insertions, 2 deletions
diff --git a/device_cio_free b/device_cio_free
index 1c895b3..59e4e33 100644
--- a/device_cio_free
+++ b/device_cio_free
@@ -21,13 +21,16 @@ ZNETCONFIG=/etc/ccw.conf
BLACKLIST=/proc/cio_ignore
VERBOSE=
PATH=/bin:/usr/bin:/sbin:/usr/sbin
-ALL_DEVICES=
+ALL_DEVICES= # list of all unblocked devices
WAITING_TIMEOUT=60 # maximum time to wait for all devices to appear
WAITING_TOTAL=0 # actual time spent waiting for devices
usage()
{
- echo "Usage: $CMD [-h|--help] [-V|--verbose]"
+ echo "Usage: $CMD [-h|--help] [-V|--verbose] [-d|--device <deviceid>]"
+ echo " -h|--help print this message"
+ echo " -V|--verbose be verbose"
+ echo " -d|--device <deviceid> unblock and wait for specified device"
exit 1
}
@@ -135,6 +138,10 @@ while [ $# -gt 0 ]; do
-h|--help)
usage
;;
+ -d|--device)
+ shift
+ [ -n "$1" ] && DEVICE="$DEVICE $1" || usage
+ ;;
*)
echo "Error: unknown option $1"
usage