[X2Go-Commits] [maintenancescripts] 01/01: killstalevms.bash: fetch data out of cmdline.

git-admin at x2go.org git-admin at x2go.org
Thu Feb 12 00:10:07 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 a2b6f42f6ffffbdfe5751dd1a6136dd6f733720b
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Feb 12 00:10:02 2015 +0100

    killstalevms.bash: fetch data out of cmdline.
---
 killstalevms.bash |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/killstalevms.bash b/killstalevms.bash
index 5dbc9ea..ee7eafa 100644
--- a/killstalevms.bash
+++ b/killstalevms.bash
@@ -17,9 +17,14 @@ for ((i = 0; i < ${#VM_LIST[@]}; ++i)); do
   BUILDER_LIST[$i]="$(perl -pe 's/.*?qemu\.(\d+)\.dev.*/\1/' < /proc/${VM_LIST[$i]}/cmdline)"
 done
 
-typeset -a COMPONENT_LIST BRANCH_LIST SYSTEM_LIST
+typeset -a COMPONENT_LIST BRANCH_LIST SYSTEM_LIST SYSTEM_VERSION_LIST ARCH_LIST VERSION_LIST
 
 for ((i = 0; i < ${#BUILDER_LIST[@]}; ++i)); do
   TMP_CMDLINE="$(< /proc/${BUILDER_LIST[$i]}/cmdline)"
-  COMPONENT_LIST[$i]="$(perl -pe 's///' <<< "${TMP_CMDLINE}")"
+  BRANCH_LIST[$i]="$(perl -pe 's#.*?/pkg-dist/(.*?)/.*#\1#' <<< "${TMP_CMDLINE}")"
+  COMPONENT_LIST[$i]="$(perl -pe 's#.*?/pkg-dist/.*?/(.*?)/.*#\1#' <<< "${TMP_CMDLINE}")"
+  SYSTEM_LIST[$i]="$(perl -pe 's#.*?/pkg-dist/.*?/.*?/(.*?)/.*#\1#' <<< "${TMP_CMDLINE}")"
+  SYSTEM_VERSION_LIST[$i]="$(perl -pe 's#.*?/pkg-dist/.*?/.*?/.*?/(.*?)/.*#\1#' <<< "${TMP_CMDLINE}")"
+  ARCH_LIST[$i]="$(perl -pe 's#.*?/pkg-dist/.*?/.*?/.*?/.*?/(.*?)\0.*#\1#' <<< "${TMP_CMDLINE}")"
+  VERSION_LIST[$i]="$(perl -pe "s#.*?${COMPONENT_LIST}_([\d.]+)-.*#\1#' <<< "${TMP_CMDLINE}")"
 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