[X2Go-Commits] [maintenancescripts] 01/01: killstalevms.bash: add "more information" yes/no dialog.

git-admin at x2go.org git-admin at x2go.org
Thu Feb 12 02:31:28 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 fae0ed87b5586f7dc7f12efa96157e8d619f4c4d
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Feb 12 02:31:21 2015 +0100

    killstalevms.bash: add "more information" yes/no dialog.
---
 killstalevms.bash |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/killstalevms.bash b/killstalevms.bash
index 99ef10f..3f96003 100644
--- a/killstalevms.bash
+++ b/killstalevms.bash
@@ -47,4 +47,16 @@ for ((i = 0; i < ${#BUILDER_LIST[@]}; ++i)); do
   DIALOGMENU+=("$i" "${VM_LIST[$i]}: ${COMPONENT_LIST[$i]} (${VERSION_LIST[$i]}) for ${BRANCH_LIST[$i]}")
 done
 
-dialog --menu "Select VM to kill" 0 0 10 "${DIALOGMENU[@]}"
+while [ "${RESULT}" -eq "0" ]; then
+  MOREINFO=$(dialog --menu "Select VM to kill" 0 0 10 "${DIALOGMENU[@]}")
+  RESULT="$?"
+
+  if [ "${RESULT}" -eq "0" ]; then
+    dialog --yesno "PID: ${VM_LIST[${MOREINFO}]\nComponent: ${COMPONENT_LIST[${MOREINFO}]}\nVersion: ${VERSION_LIST[${MOREINFO}]}\nOS: ${SYSTEM_LIST[${MOREINFO}]} -- ${SYSTEM_VERSION_LIST[${MOREINFO}]} -- ${ARCH_LIST[${MOREINFO}]}\nBranch: ${BRANCH_LIST[${MOREINFO}]}\n\nPlease check that this job is currently not being actively executed by Jenkins!\n\nAre you sure you want to kill this process?" 0 0
+    RESULT="$?"
+
+    if [ "${RESULT}" -eq "0" ]; then
+      echo kill -9 "${VM_LIST[${MOREINFO}]}"
+    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