boot
talker/bin/boot · 1.2 KB
From the archive PG96.tar.gz
Download the archive « Back to the archive contents
#!/bin/sh
# The port we run on
PORT=2060
# The name of the angel
ANGEL=angel
# The name of the server
SERVER=playground
# The location of all the files
PATHDIR="/home/talker/work/"
# Name of a file to log info to
BOOTERROR=boot-script.log
cd $PATHDIR/bin
#If the angel and the server are BOTH down, then rerun the angel.
if [ "`ps -x|egrep '$ANGEL'|egrep 4242|egrep -v egrep`" = "" ]; then
if [ "`ps -x|egrep '$SERVER'|egrep 4242|egrep -v egrep`" = "" ]; then
angel &
exit 0
fi
fi
#If the angel and the server are both UP, exit
if [ "`ps -x|egrep '$ANGEL'|egrep 4242|egrep -v egrep`" != "" ]; then
echo 4.1
if [ "`ps -x|egrep '$SERVER'|egrep 4242|egrep -v egrep`" != "" ]; then
# echo both alive
exit 0
fi
fi
#If one or the other is down, send error.
#echo "+++++" >> $PATHDIR/BOOTERROR
#echo "Boot failed because either the $ANGEL or the server was already alive" >> \
#$PATHDIR/BOOTERROR
#echo `date` >> $PATHDIR/BOOTERROR
#echo "Error is :" >> $PATHDIR/BOOTERROR
if [ "`ps -x|egrep '$ANGEL'|egrep 4242|egrep -v egrep`" != "" ]; then
# echo "Angel ALIVE" >> $PATHDIR/BOOTERROR
fi
if [ "`ps -x|egrep '$SERVER'|egrep 4242|egrep -v egrep`" != "" ]; then
# echo "Server ALIVE" >> $PATHDIR/BOOTERROR
fi