git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/localfs/usr/local/bin/virtmc
diff options
context:
space:
mode:
Diffstat (limited to 'localfs/usr/local/bin/virtmc')
-rwxr-xr-xlocalfs/usr/local/bin/virtmc22
1 files changed, 22 insertions, 0 deletions
diff --git a/localfs/usr/local/bin/virtmc b/localfs/usr/local/bin/virtmc
new file mode 100755
index 0000000..5fee1bb
--- /dev/null
+++ b/localfs/usr/local/bin/virtmc
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+[ -z "$LIBVIRT_DEFAULT_URI" ]&&CONNURI="qemu:///system"||CONNURI="$LIBVIRT_DEFAULT_URI"
+[ -z "$1" ]&&echo "Viciously refusing to connect to the KVM console of the zero pointer." >&2&&exit 1
+
+virtmhelp() {
+ echo -e "USAGE:\tvirtmc|virtme|virtmp"
+ echo
+ (
+ echo ";virtmc:;Shows the domain's console screen"
+ echo ";virtme:;Shows the domain editor without going to the console screen"
+ echo ";virtmp:;Shows the domain's performance"
+ )|column -s\; -t --table-right 2
+}
+[ "$1" == "-h" ]&&virtmhelp&&exit 0
+
+case "$(basename $0)" in
+ virtmc) virt-manager -c "$CONNURI" --show-domain-console "$1";;
+ virtme) virt-manager -c "$CONNURI" --show-domain-editor "$1";;
+ virtmp) virt-manager -c "$CONNURI" --show-domain-performance "$1";;
+ *) echo "Fatal exception: do not simply symlink stuff without knowing what you do!" >&2;exit 1;;
+esac