I've been using "VNC Viewer Free Edition 4.1.1 for X" so that I can remote control other machines in the house, but if the machine I try to connect to is down/unavailable/switched off etc, the vncviewer command kind of hangs and I can't do anything on my desktop (except wiggle my mouse) until it times out after a few minutes. Needless to say, this was annoying me. Wrote a simple script called vncsafe:
#!/bin/sh
ping $1 >/dev/null 2>&1
if [ $? = 0 ]; then
vncviewer $1 &
else
zenity --error --text="$1 is not responding."
fi
Works a treat
tags: Solaris SUN X86 VNC