Skip to content

Instantly share code, notes, and snippets.

@viebig
Forked from thiagomr/sendsms.bash
Created June 23, 2016 20:57
Show Gist options
  • Select an option

  • Save viebig/0f6240b5c7eb368aa6349a362efa2070 to your computer and use it in GitHub Desktop.

Select an option

Save viebig/0f6240b5c7eb368aa6349a362efa2070 to your computer and use it in GitHub Desktop.
#!/bin/bash
args=("$@")
token=${args[0]}
number=${args[1]}
message=${args[2]}
numbers=(${number//,/ })
for i in "${!numbers[@]}"
do
curl -s -X POST -H "Authorization: Basic '$token'" \
-H "Cache-Control: no-cache" \
-d '{ "to": '${numbers[i]}', "message": '\"$message\"' }' \
"https://sms-api-pointer.pontaltech.com.br/v1/single-sms" > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment