summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2014-01-15 13:02:51 +0100
committerDan Horák <dan@danny.cz>2014-01-15 13:02:51 +0100
commitd92d73a2fd97ac7220d5b6b001e0b05c8c07d2f9 (patch)
treef0e0d9cd7b42cbede6c1201ea102677a8bb48ee9
parent21104f6814b6fb874e1616497fccbfeb796eb18c (diff)
downloadutils-d92d73a2fd97ac7220d5b6b001e0b05c8c07d2f9.tar.gz
utils-d92d73a2fd97ac7220d5b6b001e0b05c8c07d2f9.tar.xz
utils-d92d73a2fd97ac7220d5b6b001e0b05c8c07d2f9.zip
check current online state before setting zfcp device online
zfcpconf.sh tries to online a zfcp device multiple times (rhbz#1042496)
-rw-r--r--zfcpconf.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/zfcpconf.sh b/zfcpconf.sh
index ff8506f..b2da28f 100644
--- a/zfcpconf.sh
+++ b/zfcpconf.sh
@@ -46,7 +46,8 @@ if [ -f "$CONFIG" ]; then
WWPN=$2
FCPLUN=$3
fi
- echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
+ [ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` == "0" ] \
+ && echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
;;