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-readsms.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'e3372-readsms.sh') diff --git a/e3372-readsms.sh b/e3372-readsms.sh index c265dfa..cf54c5f 100755 --- a/e3372-readsms.sh +++ b/e3372-readsms.sh @@ -4,15 +4,10 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "$DIR/include.sh" get_token +post_xml "sms/sms-list" "1101001" -curl -s -X POST "http://$MODEM_IP/api/sms/sms-list" \ - -H "Cookie: $COOKIE" \ - -H "__RequestVerificationToken: $TOKEN" \ - -H "Content-Type: text/xml" \ - -d "1101001" >modem_status.xml +#cat $STATUS_FILE -#cat modem_status.xml - -message=$(grep -r -E 'Phone|Content' modem_status.xml | sed -e 's/<[^>]*>//g' | sed -e 's/^[ \t]*/------\n/g') +message=$(grep -r -E 'Phone|Content' $STATUS_FILE | sed -e 's/<[^>]*>//g' | sed -e 's/^[ \t]*/------\n/g') echo "$message\n------" -- cgit v1.2.3