From c08f7e342ac370bf99223fcd84e31a5b54fd26a8 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 22 Feb 2026 15:40:33 -0700 Subject: [PATCH] feat(cmd/sendsms): add back curl script for testing --- cmd/sendsms/example.env | 1 + cmd/sendsms/sms-curl.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 cmd/sendsms/sms-curl.sh diff --git a/cmd/sendsms/example.env b/cmd/sendsms/example.env index a7a796c..cf96cc2 100644 --- a/cmd/sendsms/example.env +++ b/cmd/sendsms/example.env @@ -3,3 +3,4 @@ export SMSGW_BASEURL=https://smsgateway.example.com export SMSGW_USERNAME=sms export SMSGW_PASSWORD=xxxx-xxxx-xxxx-xxxx +export SMSGW_TEST_NUMBER=+18005551234 diff --git a/cmd/sendsms/sms-curl.sh b/cmd/sendsms/sms-curl.sh new file mode 100755 index 0000000..92acaca --- /dev/null +++ b/cmd/sendsms/sms-curl.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# 2020-02-20 02:20:22 +g_ts=$(date '+%F %T') +. ./.env + +curl --fail-with-body -X POST "${SMSGW_BASEURL}/messages" \ + --user "${SMSGW_USERNAME}:${SMSGW_PASSWORD}" \ + -H 'Content-Type: application/json' \ + --data-binary ' + { + "textMessage":{ + "text": "Test message. It'\''s '"${g_ts}"'" + }, + "phoneNumbers": ["'"${SMSGW_TEST_NUMBER}"'"], + "priority":65 + } + '