[X-Unix] kill and restart filemaker

Eric F Crist ecrist at secure-computing.net
Wed May 31 10:49:52 PDT 2006


You are probably looking for status codes.  As an example, I'm trying  
to ping an IP address.  If ping was able to ping the IP it exits with  
a 0, if it was NOT able to ping, it exits with a 2.  Here's an  
example script:

#!/bin/sh
echo -n 'IP: '
read ip
ping -c 1 $ip > /dev/null
retcode=$?
if [ $retcode = "0" ]
         then echo "I was able to ping $ip successfully!"
elif [ $retcode = "1" ]
         then echo "There was an error executing the ping command.   
Please try again."
elif [ $retcode = "2" ]
         then echo "I was unable to ping $ip."
fi

I hope this helps!



On May 31, 2006, at 2:21 AM, Ferdinand Fuchs wrote:

> hello,
>
> I try to make a script to kill filemaker (we use it with  
> webcompanion and webstar for a website) if it hangs but have  
> already problems at the beginning.
>
> first how do I determine if filemaker hangs - I thought about to  
> ping the port 5003, that uses filemaker, so the first line of my  
> script would be
>
> nmap -PE localhost | grep 5003 > /tmp/status.txt
>
> now I thought I could use "if then else" but I couldn't find a  
> syntax that would fit for
>
> if status.txt does contain the word 5003 then kill filemaker and  
> open specific filemaker-files afterwards else do nothing
>
> it would be cool if somebody could give me a clue to create such a  
> script - thanks!
>
>
> ferdinand
> _______________________________________________
> X-Unix mailing list
> X-Unix at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix
>
> Listmom is trying to clean out his closets! Vintage Mac and random  
> stuff:
>          http://search.ebay.com/_W0QQsassZmacguy1984
>

-----
Eric F Crist
Secure Computing Networks
http://www.secure-computing.net



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://listserver.themacintoshguy.com/pipermail/x-unix/attachments/20060531/6cca5c6f/PGP.bin


More information about the X-Unix mailing list