Follow by Email

Thursday, March 15, 2007

FCI-H Result Checker Shell Script

This script will inform you in case the result of year 4, CS did appear by playing an mp3 file (it can be of other several types, like wav etc.). Put it in shell script file and run it from the shell. Enjoy.

#!/bin/bash
while true
do
if [ -z $(wget -qO - http://www1.itchelwan.edu.eg/itchelwan/db/fac_db/36/5/120/ | grep -i 'x1') ]
then
echo 'no' $(date +%H:%M:%S);
sleep 10s
else
echo 'yes'
play /your/sound/file.mp3 &
sleep 60m
fi
done

4 comments:

Magdy Wageeh said...

:D cool script.
but if I was sleeping or my Pc is turn off...
I wanna way to send a massage to my mobile... :)

Mohammad Nabil said...

If you was sleeping the scripts is playing an MP3 file anyway :D (you can specify the volume as a parameter too). You can send an email too. About SMS you can hack the Google SMS notification service ;)

Mohammad Nabil said...

You can send mail using:
sendmail "you@domain.com" < messageFile

Mohammad Nabil said...

or
echo "message" | sendmail "you@domain.com"