Last active
July 5, 2017 18:42
-
-
Save silgon/4134bc16c3b30cd746b3a75f39f92398 to your computer and use it in GitHub Desktop.
HiLink Send Message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo usb_modeswitch -v 12d1 -p 1f01 -J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage: | |
# send number "message\n with new lines if you wish" | |
NUMBER=$1 # phone number | |
SMS=$(echo $2) # with echo in order to be able to send newlines with \n | |
# ${#SMS} # that variable tells the number of characters in the sms | |
curl http://192.168.8.1/api/sms/send-sms -d "<?xml version:"1.0" encoding="UTF-8"?><request><Index>-1</Index><Phones><Phone>$NUMBER</Phone></Phones><Sca></Sca><Content>$SMS</Content><Length>${#SMS}</Length><Reserved>1</Reserved><Date>$(date +%Y-%m-%d\ %H:%M:%S)</Date></request>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment