First page Back Continue Last page Overview Graphics
#!/bin/sh
# checkcalls
# quick and very dirty way to see if new data has been
# added to the caller-id log and, if so, email it to me
# location of caller-id info
DIR=/home/dtoppin/calls
# we delay a bit here to give the cidd daemon time to initialize
sleep 15
cd $DIR
# we use this file as a flag for the last time that
# we noticed an update to the log
touch timestamp
while :
do
if test calls.txt -nt timestamp
then
(echo 'Subject: call'; echo ; tail -1 calls.txt ; echo '.') > /tmp/b
echo "running sendmail at `date`"
-
touch timestamp
# try to message me
/home/dtoppin/bin/aimmessage "`cat /tmp/b`" > /tmp/aim.log 2>&1
sleep 60
else
sleep 60
fi
done
Notes: