X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_usr%2Fv3_vncclient;h=c84a288b7b2a7b39d57284c3256fdf5a895014cc;hb=d0aa5bd27c22a33f04f47363910f9773fdeab7eb;hp=3aca8865c410761a100563cb818cdb5cae259e14;hpb=384394434d203f0c19d2ef8f1bc45a446759e270;p=palacios.git diff --git a/linux_usr/v3_vncclient b/linux_usr/v3_vncclient index 3aca886..c84a288 100755 --- a/linux_usr/v3_vncclient +++ b/linux_usr/v3_vncclient @@ -8,6 +8,24 @@ $password = ""; &GetOptions("port=i"=>\$port, "password=s"=>\$password); +if (!on_path("vncviewer")) { + print "You do not have vncviewer available on your PATH.\n"; + print "v3_vncclient requires this functionality.\n"; + print "You probably need to install vncviewer (e.g., yum install vncviewer)\n"; + exit -1; +} + system "vncviewer localhost:$port\n"; + + +sub on_path { + my $x = `which $_[0] 2>&1`; + if (!defined($x) || $x=~/no $_[0] in/) { + return 0; + } else { + return 1; + } +} +