diff options
author | H. P. <harald.p.@xmart.de> | 2018-11-01 13:30:58 +0100 |
---|---|---|
committer | H. P. <harald.p.@xmart.de> | 2018-11-01 13:30:58 +0100 |
commit | 0632591996893fe136a1f2fe44d9b9f404f41f3e (patch) | |
tree | 7340edbe7c212da3db45a83219147143a3268c8d /localfs/usr/local/bin/virtmc | |
download | fedora-laptop-0632591996893fe136a1f2fe44d9b9f404f41f3e.tar.bz2 |
Initial commit
Diffstat (limited to 'localfs/usr/local/bin/virtmc')
-rwxr-xr-x | localfs/usr/local/bin/virtmc | 22 |
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 |