init-rbdmap: fix error on stop rbdmap

Avoid an error on stop service if many /dev/rbd* exist.

Signed-off-by: Laurent Barbe <laurent@ksperis.com>
This commit is contained in:
Laurent Barbe 2013-08-22 12:12:49 +02:00
parent 17859e1477
commit b419924b18

View File

@ -68,7 +68,7 @@ do_unmap() {
umount $MNT
done
# Unmap all rbd device
if [ -b /dev/rbd[0-9]* ]; then
if ls /dev/rbd[0-9]* >/dev/null 2>&1; then
for DEV in /dev/rbd[0-9]*; do
log_progress_msg $DEV
rbd unmap $DEV