Not directly WiTango but related.

I use a shell script triggered once a minute to check whether or not the
WiTango process is alive and if it isn't to resurrect it. It looks like
this:

#!/bin/sh 
#checking to see if witangod exists and writing to a variable
/bin/ps ax |grep witango |egrep -v "grep|checkwitango" > /dev/null 2>&1
#echo "$checktango"
if [ $? = "0" ]; then
    echo "Witango is still Running - `date`" >>
/Applications/WitangoServer/5.5/Logs/log.WitangoServer/checkwitango.log
else
    echo "ERROR - Witango is NOT Running - `date`" >>
/Applications/WitangoServer/5.5/Logs/log.WitangoServer/checkwitango.log
    cd /
    cd /Applications/WitangoServer/5.5
    ./witangod -u "wayneirvine"
    if [ $? != "0" ]; then
        echo "I could not run Witango - `date`" >>
/Applications/WitangoServer/5.5/Logs/log.WitangoServer/checkwitango.log
    fi
fi

I'm now trying to write the equivalent for FileMaker Pro as it has developed
a habit of dying periodically. I'll get onto the debugging after I've got a
solution for this issuse. My new script looks like this:

#!/bin/sh 
#checking to see if FMP exists and writing to a variable
/bin/ps ax |grep FileMaker\ Pro |egrep -v "grep|checkFMP" > /dev/null 2>&1
#echo "$checkFMP"
if [ $? = "0" ]; then
    echo "FMP is still Running - `date`" >>  /Applications/FileMaker\ Pro\
5.5\ Folder/logs/checkFMP.log
else
    echo "ERROR - FMP is NOT Running - `date`" >>  /Applications/FileMaker\
Pro\ 5.5\ Folder/logs/checkFMP.log
    cd /
    cd /FileMaker\ Pro 5.5 Folder/
    ./FileMaker\ Pro.app -u "wayneirvine"
    if [ $? != "0" ]; then
        echo "I could not run FMP - `date`" >>  /Applications/FileMaker\
Pro\ 5.5\ Folder/logs/checkFMP.log
    fi
fi

Problems: It doesn't seem top recognise when FileMaker has died. The grep
still gives a false positive.

Also, I'm not sure whether I should be looking for FileMaker\ Pro or
FileMaker\ Pro.app (inside the FileMaker\ Pro package) and which I should be
launching in case of an error.

Also, I need to launch the app and open a file and I have no idea how to do
this in a shell script.

Any help you can give would be greatly appreciate.

Wayne Irvine
                  Byte Services Pty Ltd
               http://www.byteserve.com.au/
                  [EMAIL PROTECTED]
   Ph 02 9960 6099   Mob 0409 960 609   Fax 02 9960 6088

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to