summaryrefslogtreecommitdiffstats
path: root/scripts/gluster.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gluster.sh')
-rwxr-xr-xscripts/gluster.sh18
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