aboutsummaryrefslogtreecommitdiff
path: root/kvmx-vdagent
diff options
context:
space:
mode:
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