diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-03-11 19:56:38 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-03-11 19:56:38 +0100 |
commit | f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf (patch) | |
tree | 3522ce77203da92bb2b6f7cfa2b0999bf6cc132c /scripts/gluster.sh | |
parent | 6bc3a3ac71e11fb6459df715536fec373c123a97 (diff) | |
download | ands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.tar.gz ands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.tar.bz2 ands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.tar.xz ands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.zip |
Various fixes before moving to hardware installation
Diffstat (limited to 'scripts/gluster.sh')
-rwxr-xr-x | scripts/gluster.sh | 18 |
1 files changed, 11 insertions, 7 deletions
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 |