X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_usr%2Fv3_vncclient;h=c84a288b7b2a7b39d57284c3256fdf5a895014cc;hb=1fcc40a92f8cadc3d6ed3f56abc316c11043bc80;hp=3aca8865c410761a100563cb818cdb5cae259e14;hpb=e30e35a15e2350e77f71e5b052b5a67a77cdf267;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; + } +} +