#!/bin/sh

if [ -e /var/tmp/xbiffrestart.pid ] ; then
    kill -HUP `cat /var/tmp/xbiffrestart.pid`
fi

>/var/tmp/xbiffrestart.pid

(while : ; do
	ssh -t -n -l tcon suphys xbiff -geometry +770-1
	sleep 300	#try again after 5 minutes, if connection died.
done) > /dev/null 2>/dev/null &
echo $! >> /var/tmp/xbiffrestart.pid


xload -geometry 40x40-2-2 &

(while : ; do
	ssh -t -n -l tcon suphys xload -geometry 40x40-44-2
	sleep 300	#try again after 5 minutes, if connection died.
done) > /dev/null 2>/dev/null &
echo $! >> /var/tmp/xbiffrestart.pid

(while : ; do
	ssh -t -n -l tcon hera xload -geometry 40x40-86-2
	sleep 300	#try again after 5 minutes, if connection died.
done) > /dev/null 2>/dev/null &
echo $! >> /var/tmp/xbiffrestart.pid

(while : ; do
	ssh -t -n -l tcon simonj xload -geometry 40x40-128-2
	sleep 300	#try again after 5 minutes, if connection died.
done) > /dev/null 2>/dev/null &
echo $! >> /var/tmp/xbiffrestart.pid

