Skip to content

Instantly share code, notes, and snippets.

@silgon
Last active July 5, 2017 18:42
Show Gist options
  • Save silgon/4134bc16c3b30cd746b3a75f39f92398 to your computer and use it in GitHub Desktop.
Save silgon/4134bc16c3b30cd746b3a75f39f92398 to your computer and use it in GitHub Desktop.
HiLink Send Message
sudo usb_modeswitch -v 12d1 -p 1f01 -J
#!/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