echo $$ > ftpprocess.lock
if [ -f "ftpprocess.lock" ]; then
echo "ftp process has timed out"
kill -9 `cat ftpprocess`
sh ftpprocess.sh &
all above code is hand written and untested and may need to be modified to fit your circumstances.
if the process runs often you will have to kill the ftpwatch.sh on sucessful completion of ftppreocess