From 91b6b387e19ad2b2f686e8a27bfc0a027e9eb4d9 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 22 Mar 2021 23:25:34 +0300 Subject: eliminate a lot of copypasta by using functions --- e3372-sendsms.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'e3372-sendsms.sh') diff --git a/e3372-sendsms.sh b/e3372-sendsms.sh index 9740775..6b7e3fa 100755 --- a/e3372-sendsms.sh +++ b/e3372-sendsms.sh @@ -3,12 +3,9 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "$DIR/include.sh" -get_token +SMS_DATA="-1363USAGE51-1" -curl -s -X POST "http://$MODEM_IP/api/sms/send-sms" \ - -H "Cookie: $COOKIE" \ - -H "__RequestVerificationToken: $TOKEN" \ - -H "Content-Type: text/xml" \ - -d "-1363USAGE51-1" >modem_status.xml +get_token +post_xml "sms/send-sms" "$SMS_DATA" > $STATUS_FILE -cat modem_status.xml \ No newline at end of file +cat $STATUS_FILE \ No newline at end of file -- cgit v1.2.3