[X2Go-Commits] [maintenancescripts] 01/01: killstalevms.bash: loop correctly and remove elements from menu once they are killed.

git-admin at x2go.org git-admin at x2go.org
Thu Feb 12 03:03:47 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository maintenancescripts.

commit 5a5411e44ba5669863103205341681689df20a43
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Feb 12 03:03:41 2015 +0100

    killstalevms.bash: loop correctly and remove elements from menu once they are killed.
---
 killstalevms.bash |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/killstalevms.bash b/killstalevms.bash
index 1f5245a..c2ead48 100644
--- a/killstalevms.bash
+++ b/killstalevms.bash
@@ -58,6 +58,18 @@ while [ "${RESULT}" -eq "0" ]; do
 
     if [ "${RESULT}" -eq "0" ]; then
       echo kill -9 "${VM_LIST[${MOREINFO}]}"
+
+      # Remove current element from lists.
+      VM_LIST=("${VM_LIST[@]:${MOREINFO}}")
+      BRANCH_LIST=("${BRANCH_LIST[@]:${MOREINFO}}")
+      COMPONENT_LIST=("${COMPONENT_LIST[@]:${MOREINFO}}")
+      SYSTEM_LIST=("${SYSTEM_LIST[@]:${MOREINFO}}")
+      SYSTEM_VERSION_LIST=("${SYSTEM_VERSION_LIST[@]:${MOREINFO}}")
+      ARCH_LIST=("${ARCH_LIST_LIST[@]:${MOREINFO}}")
+      VERSION_LIST=("${VERSION_LIST[@]:${MOREINFO}}")
+    else
+      # Continue at the menu.
+      RESULT="0"
     fi
   fi
 done

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git


More information about the x2go-commits mailing list