#!/bin/bash if [ -z $1 ]; then echo "usage: vncconnect.sh " exit 1 else hostname=$1 echo "digging ssh tunnel to $hostname"; sleep 1 ssh $hostname -L 8900/localhost/5901 "sleep 05 && exit" & sleep 02 vncviewer localhost:8900 echo "killed ssh tunnel to $hostname and ended vnc session" fi #end of file