I am not new to SMSTools - in fact have been running it on and off for about 5/7 years - but only as one user.
So first off thank you to everyone involved, it's an amazing product.
I am now in a position to ask for some script and SMS tools help.
What I am trying to do , is write a bash script - or perl or whatever, that will run in event handler..
It kinda works, but I am struggling with a few things..
Here is the script:
Firstly whats working - if the sms is only one line it works brilliantly, the keyword lookup with associated email address sends the incoming message to the email address registered with that keyword in a database.
If there is no valid keyword - then email the message to a catchall email address.
What's not working or more importantly what I am trying to achieve, if there is a valid 'keyword' only look it up as the first word on the first line of the text message.
Currently if the text message is multiple lines, then each first word on each line becomes part of the keyword which it can't find in the database.
Then remove the 'keyword' from the message before its emailed off to the registered email address.
If anyone has any experience with sed, or could suggest a better way, that would be amazing.
Thanks so much in advance, and hope to hear from some of you soon.
« Last edit by video_dude on Fri Apr 22, 2016 00:15, 52 months ago. »