I setup an SMS gateway which is accessible via browser. I used curl to do this.
#curl -u user
The file is on html format and I need to grep where the SMS messages is so I did
#cat /tmp/somefile.txt | grep -i "var sms"
The output example file as below:
var sms= ["11-27 08:34:28,SENDER,MESSAGE1","11-27 05:25:58,SENDER,MESSAGE2","11-27 05:25:58,SENDER,MESSAGE3"];
and so on and so forth.
What I want to do is to get output of this html and trim these SMS messages. Maybe a crontab every 10 or 15 minutes that will get the output via curl compare the previous file and if there is any change, send the output to an email. I would also need to parse the above value correctly so it will be easier to read in the email. Thanks.