Well, of of many ways is to create a script that autostarts everytime the systems turns on.
PHP Code:
#!/bin/sh
Create an array of ten sites or more.
ARRAY=(
site1
site2
..
..
..
}
while [ true ]
do
Select a random site.
RANGE=${#ARRAY[*]}
number=$RANDOM
let "number %= $RANGE"
if [ `wget -O /tmp/trash.html ${ARRAY[$number]}` == TIMEOUT ]
then
create a new connection
fi
sleep 60;
done;
Or if you want to check if some process is alive
PHP Code:
#!/bin/bash
while [ true ]
do
if [ "`ps aux | grep your_proc | grep -v grep`" == "" ]
then
echo 'Not alive, create connection or run some command'
fi
sleep 60;
done;