#! /bin/bash
# Generic respawn

trap '' `seq 0 64`
trap SIGCHLD

VNCBIN=$(type -p vncviewer)

#Fix vncviewer font error
#echo "*popup*font: fixed" | xrdb -merge;

if [ -n "$VNCBIN" -a  -x "$VNCBIN" ]
then 
	$VNCBIN "$@"
	status=$?
	echo $status > /tmp/junk
	if [ -f ~/.v-Class-Student/ccvdclientfile ]
	then
		#test $status -ne 0 \ &&
		 sleep 1 && exec $0 "$@"
		exit $status
	fi
else
	kdialog --error "File vncviewer not found"
fi
