diff --git a/virssh b/virssh index 1f923fa..5d326c7 100755 --- a/virssh +++ b/virssh @@ -1,9 +1,17 @@ #!/usr/bin/perl +# +# virssh - allow users to control their libvirt VM through SSH. +# +# For usage please see README.md. +# + use strict; use warnings; my $logtag = $0; my $vm = $ARGV[0]; +my $HOSTNAME = `hostname -f` || "vmserver"; chomp($HOSTNAME); +my $USER = $ENV{"USER"} || "vmadmin"; my $SSH_ORIGINAL_COMMAND = $ENV{"SSH_ORIGINAL_COMMAND"} || ""; if ($SSH_ORIGINAL_COMMAND =~ /^sudo virsh (list|console $vm|destroy $vm|shutdown $vm|start $vm( --console)?)$/s) { @@ -15,12 +23,12 @@ if ($SSH_ORIGINAL_COMMAND =~ /^sudo virsh (list|console $vm|destroy $vm|shutdown print STDERR <