I'm new here and I am eager to learn bash.
I started learning it for a sms platform that I am building. It is sending sms for around 1000 people in rural Mozambique (poor coverage in rural areas)
I have a shell script that executes the following:
# My first script
echo "Page 1"
gsmsendsms -d /dev/ttyUSB0 -b 19200 -r 86XXXXXXX "Text of SMS message 1"
gsmsendsms -d /dev/ttyUSB0 -b 19200 -r 84XXXXXXX "Text of SMS message 2"
echo "Page 22
gsmsendsms -d /dev/ttyUSB0 -b 19200 -r 82XXXXXXX "Text of SMS message"
My problem is that the carrier that I am using (can't change it at the moment) has a limit of 50 pending messages per user. So if more than 50 people have no network, or have the cellphone turned off the sms's will stop going!
I have no way to know which numbers didn't receive as the error message in the shell is just:
gsmsendsms[ERROR]: ME/TA error 'unknown error' (code 500)
However, if I wait a while the things will start going again.
My idea was to tell the bash script to stop and wait like 30 mins in case that error occurs, it would be even great if it would print the last line of the script!. Is it possible? Or at least tell the script to every once in a while pause for a certain amount of time (even if I have to copy paste that command all over the file)
Thank you all!!