Skip to content

Instantly share code, notes, and snippets.

@provegard
Created June 9, 2018 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save provegard/6334809c154e1664707a96e0490c4f12 to your computer and use it in GitHub Desktop.
Save provegard/6334809c154e1664707a96e0490c4f12 to your computer and use it in GitHub Desktop.
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