]> gitweb.fluxo.info Git - vbox.git/commitdiff
Fix clip action
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 19 Feb 2017 18:10:08 +0000 (15:10 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 19 Feb 2017 18:10:08 +0000 (15:10 -0300)
kvmx

diff --git a/kvmx b/kvmx
index 410fece8f739af96ab4461bb88cac4955f879ef7..2e3962a3837a7b1986f7bc0264c2f0cebdf47a97 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -12,10 +12,10 @@ ACTION="$1"
 VM="$2"
 
 # Check
-if [ -z "$VM" ]; then
+if [ -z "$VM" ] && [ "$ACTION" != "clip" ]; then
   echo "usage: $BASENAME <action> <vm>"
   exit 1
-elif [ ! -e "$STORAGE/$VM.img" ]; then
+elif [ ! -e "$STORAGE/$VM.img" ] && [ "$ACTION" != "clip" ]; then
   echo "file not found: $STORAGE/$VM.img"
   exit 1
 fi
@@ -42,7 +42,7 @@ if [ "$ACTION" == "up" ]; then
   # Fix window titles
   xdotool search --name "SPICEc:0" set_window --name $VM
 elif [ "$ACTION" == "clip" ]; then
-  local instances="`ps -o pid,command -e | grep "spice-vdagent$" | cut -d ' ' -f 2 | xargs`"
+  instances="`ps -o pid,command -e | grep "spice-vdagent$" | cut -d ' ' -f 2 | xargs`"
 
   # Kill old instances
   for pid in $instances; do