![]() ![]() ![]() ![]() This is maybe not very good coding, but it works.Īlthough Peter has explained it really nicely, but I like to have single script, and also I use it on OpenWrt routers instead of Debian. TOKEN=$(curl -s -b session.txt -c session.txt )įinally a third shell script for sending the sms, which also invokes the two other scripts: #!/bin/bashĬurl -v -b session.txt -c session.txt -H "X-Requested-With: XMLHttpRequest" -data "$SMS" -header "_RequestVerificationToken: $TOKEN" -header "Content-Type:text/xml"Īnd for receiving the last unread sms (or, if not avaiable, the last read sms) I use the following script: #!/bin/bashĬurl -b session.txt -c session.txt -H "X-Requested-With: XMLHttpRequest" -data "$DATA" -header "_RequestVerificationToken: $TOKEN" -header "Content-Type:text/xml" For getting the session id I use the following command in an own shell script: #!/bin/bashĬurl -b session.txt -c session.txt > /dev/null 2>&1įor getting the token I use the following commands, also in an own shell script: #!/bin/bash
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |