Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Send SMS script
#/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