From 5655284a963b60d39354ce7ef38bc4515d61e878 Mon Sep 17 00:00:00 2001 From: Dan HorĂ¡k Date: Fri, 28 May 2010 10:20:10 +0200 Subject: 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). --- device_cio_free | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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" -- cgit