Created
June 9, 2018 08:00
-
-
Save provegard/6334809c154e1664707a96e0490c4f12 to your computer and use it in GitHub Desktop.
Send SMS script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
dest=$1 | |
test -n "$dest" || exit 1 | |
read text | |
user=`whoami` | |
retries=5 | |
cont=1 | |
while test $retries -gt 0 -a $cont -ne 0; do | |
/usr/bin/gammu -c /etc/gammurc -d textall -f /tmp/gammu-$user.log sendsms TEXT $dest -textutf8 "$text" | |
cont=$? | |
if test $cont -ne 0; then | |
echo Retrying in a short while... | |
sleep 2 | |
let retries=retries-1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment