aboutsummaryrefslogtreecommitdiff
path: root/kvmx-vdagent
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-09 19:04:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-09 19:04:24 -0300
commit1cddbe0234efe158b6c05f21d742eb9489887cc4 (patch)
treee40bab6faf590e6d22e7b2360904155bbb0cef58 /kvmx-vdagent
parent65f7ac258a41402bb9b00c87af621a65dfbfa6e0 (diff)
downloadkvmx-1cddbe0234efe158b6c05f21d742eb9489887cc4.tar.gz
kvmx-1cddbe0234efe158b6c05f21d742eb9489887cc4.tar.bz2
Project revamp: full workflow
Diffstat (limited to 'kvmx-vdagent')
-rwxr-xr-xkvmx-vdagent17
1 files changed, 17 insertions, 0 deletions
diff --git a/kvmx-vdagent b/kvmx-vdagent
new file mode 100755
index 0000000..d29e2b3
--- /dev/null
+++ b/kvmx-vdagent
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Restart spice-vdagent inside the guest
+#
+
+# Get instances
+instances="`ps -o pid,command -e | grep "spice-vdagent$" | cut -d ' ' -f 2 | xargs`"
+
+# Kill old instances
+for pid in $instances; do
+ kill -9 $pid &> /dev/null
+done
+
+# Just to make sure we're inside a virtual machine
+if which spice-vdagent &> /dev/null ; then
+ spice-vdagent
+fi