]> gitweb.fluxo.info Git - hydra.git/commitdiff
Adds kvm-stop
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 24 Dec 2017 00:01:53 +0000 (22:01 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 24 Dec 2017 00:01:53 +0000 (22:01 -0200)
share/hydractl/kvm-stop [new file with mode: 0755]

diff --git a/share/hydractl/kvm-stop b/share/hydractl/kvm-stop
new file mode 100755 (executable)
index 0000000..f1a4533
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Workaround for stopping kVM-manager instances.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+VM="$1"
+
+# Check
+if [ -z "$VM" ]; then
+  echo "usage: $BASENAME <vm>"
+  exit 1
+fi
+
+# Run
+sv stop $VM ; sv kill $VM ; sv exit $VM
+killall $VM
+ip link set "${VM}0" down ; ip tuntap del mode tap dev "${VM}0"