summaryrefslogtreecommitdiffstats
path: root/device_cio_free
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2010-03-25 15:47:32 +0100
committerDan Horák <dan@danny.cz>2010-03-25 15:47:32 +0100
commit419d23819b7f46cb41ce9fda16b47823e94fe86f (patch)
tree3f430fcb34bd480287d89b9902bf4fbd38a0126a /device_cio_free
parent3fe1387c74899eebfe3e4a5b6714b8996eae4f5f (diff)
downloadutils-419d23819b7f46cb41ce9fda16b47823e94fe86f.tar.gz
utils-419d23819b7f46cb41ce9fda16b47823e94fe86f.tar.xz
utils-419d23819b7f46cb41ce9fda16b47823e94fe86f.zip
import 20100305
Diffstat (limited to 'device_cio_free')
-rw-r--r--device_cio_free14
1 files changed, 13 insertions, 1 deletions
diff --git a/device_cio_free b/device_cio_free
index 557427a..a596d89 100644
--- a/device_cio_free
+++ b/device_cio_free
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright 2009 Red Hat, Inc.
+# Copyright 2009, 2010 Red Hat, Inc.
# License: GPLv2
# Author: Dan Horák <dhorak@redhat.com>
#
@@ -81,6 +81,7 @@ wait_on_device()
# check how we were called
CMD=$(basename "$0")
+DIR=$(dirname "$0")
case $CMD in
"dasd_cio_free")
CONFIG=$DASDCONFIG
@@ -94,6 +95,13 @@ case $CMD in
CONFIG=$ZNETCONFIG
MODE=znet
;;
+ "device_cio_free")
+ # shortcut for calling all 3 scripts
+ $DIR/dasd_cio_free $@ || exit $?
+ $DIR/zfcp_cio_free $@ || exit $?
+ $DIR/znet_cio_free $@ || exit $?
+ exit 0
+ ;;
*)
echo "Error: unknown alias '$CMD'."
echo "Supported aliases are dasd_cio_free, zfcp_cio_free and znet_cio_free."
@@ -123,6 +131,8 @@ if [ ! -f $BLACKLIST ]; then
exit 2
fi
+[ $VERBOSE ] && echo "Freeing $MODE devices"
+
if [ $MODE = "dasd" -o $MODE = "zfcp" ]; then
# process the config file
if [ -f "$CONFIG" ]; then
@@ -173,6 +183,8 @@ if [ $MODE = "znet" ]; then
done
fi
+[ -z "$ALL_DEVICES" ] && exit 0
+
# wait until recently unblocked devices are ready
# at this point we know the content of ALL_DEVICES is syntacticly correct
OLD_IFS=$IFS