Thanks Keke,
I looked everywhere for the number of allowable event handlers and couldn't find the answer, maybe it is obvious to those who are more used to Bash scripting.
Of course the masterchk.sh is the perfect answer, I've used the source (. /) command to call the other scripts which appears to do the trick
. I've included my code to maybe help others, I hope that it's OK.
Regards
Bill.
#!/bin/sh
if [ "$1" != "RECEIVED" ]; then
exit
fi
#Check message text and retrieve sender and request
from=`formail -zx From: < $2`
text=`formail -I "" <$2 | sed -e"1d"`
if echo "$text" | grep -i "man"; then
. /usr/local/bin/mankitchk.sh
elif echo "$text" | grep -i "cir"; then
. /usr/local/bin/cirkitchk.sh
elif echo "$text" | grep -i "edi"; then
. /usr/local/bin/edikitchk.sh
elif echo "$text" | grep -i "lon"; then
. /usr/local/bin/lonkitchk.sh
else
smsfile=`mktemp /var/spool/sms/outgoing/send_XXXXXX`
echo "To: $from" >> $smsfile
echo "" >> $smsfile
echo "The keyword $text was not recognised" >> $smsfile
fi
'bash' Syntax Highlight powered by GeSHi « Last edit by
bill1798 on Tue Jan 26, 2010 16:25, 173 months ago. »