summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2010-05-28 10:20:10 +0200
committerDan Horák <dan@danny.cz>2010-05-28 10:20:10 +0200
commit5655284a963b60d39354ce7ef38bc4515d61e878 (patch)
tree90978352be0ad9a9d3d212d0eb1271e3e9ef0054
parentd18d38bf7dee09b900ec015ca6248829b1a2b6c2 (diff)
downloadutils-5655284a963b60d39354ce7ef38bc4515d61e878.tar.gz
utils-5655284a963b60d39354ce7ef38bc4515d61e878.tar.xz
utils-5655284a963b60d39354ce7ef38bc4515d61e878.zip
improve processing of devices given on command line
When the DEVICE variable exists in the environment that calls device_cio_free then the devices from the command line are appended to this value (rhbz#595569).
-rw-r--r--device_cio_free12
1 files changed, 11 insertions, 1 deletions
diff --git a/device_cio_free b/device_cio_free
index 4a986c9..71eb400 100644
--- a/device_cio_free
+++ b/device_cio_free
@@ -28,6 +28,7 @@ ZNETCONFIG=/etc/ccw.conf
BLACKLIST=/proc/cio_ignore
VERBOSE=
PATH=/bin:/sbin
+DEVICE= # list of devices given on command line
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
@@ -212,7 +213,16 @@ while [ $# -gt 0 ]; do
;;
-d|--device)
shift
- [ -n "$1" ] && DEVICE="$DEVICE,$1" || usage
+ if [ -n "$1" ]; then
+ if [ "$DEVICE" ]; then
+ DEVICE="$DEVICE,$1"
+ else
+ DEVICE=$1
+ fi
+ else
+ echo "Error: no device given"
+ usage
+ fi
;;
*)
echo "Error: unknown option $1"