From f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 11 Mar 2018 19:56:38 +0100 Subject: Various fixes before moving to hardware installation --- scripts/gluster.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/gluster.sh b/scripts/gluster.sh index 02a0a3f..9efea45 100755 --- a/scripts/gluster.sh +++ b/scripts/gluster.sh @@ -69,17 +69,21 @@ function migrate { # heal $1 -if [ -n "$1" -a "$1" != "all" ]; then - eval "$action" "$@" -else - [ "$1" == "all" ] && shift +if [ -z "$1" -a "$1" =~ ^all ]; then + all=0 + [ "$1" == "all_heketi" ] && all=1 + [ "$1" =~ ^all ] && shift vols=$(gluster volume info | grep -P '^Volume Name' | awk '{ print $NF }' | tr '\r\n' ' ') for vol in $vols; do - [[ "$vol" =~ [0-9] ]] && continue - [[ "$vol" =~ ^vol_ ]] && continue - [[ "$vol" =~ ^heketi ]] && continue + if [ $all -eq 0 ]; then + [[ "$vol" =~ [0-9] ]] && continue + [[ "$vol" =~ ^vol_ ]] && continue + [[ "$vol" =~ ^heketi ]] && continue + fi eval "$action" "$vol" "$@" done +else + eval "$action" "$@" fi -- cgit v1.2.1