#! /bin/bash
# Generic respawn

trap '' `seq 0 64`
trap SIGCHLD

VNCBIN=$(type -p vncviewer)

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