[OpenWrt-Devel] Fwd: [PATCH 1/2] wwan: Add support for CDC (Huawei 'HiLink') Modems

Jakub Jančo kubco2 at gmail.com
Tue Mar 1 04:42:39 EST 2016


I corrected filenames.

If someone want play with it:
In unlocksim.post the PIN code is not variabled.
----------- config.sh
#!/bin/sh
gateway_ip="192.168.8.1"
base_url="http://${gateway_ip}"
cookie_file="/tmp/cookie"
connect_data="connect.post"
connect_url="${base_url}/api/dialup/mobile-dataswitch"
unlocksim_data="unlocksim.post"
unlocksim_url="${base_url}/api/pin/operate"

token_url="${base_url}/html/home.html"
request_token=$(wget -q -t 0 "$token_url" -O - --save-cookies
"$cookie_file" --keep-session-cookies | grep csrf_token | head -n1 |
cut -d'"' -f4)
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------- connect.sh
#!/bin/sh

. config.sh

[ -n "$request_token" ] || {
    echo No request token found
    exit 1
}

wget -q -t 0 --load-cookies "$cookie_file"
--header="__RequestVerificationToken: $request_token" \
   --post-file="$connect_data" "$connect_url" -O -
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------- unlocksim.sh
#!/bin/sh

. config.sh

[ -n "$request_token" ] || {
    echo No request token found
    exit 1
}

wget -q -t 0 --load-cookies "$cookie_file"
--header="__RequestVerificationToken: $request_token" \
    --post-file="$unlocksim_data" "$unlocksim_url" -O -
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------- connect.post
<?xml version="1.0"
encoding="UTF-8"?><request><dataswitch>0</dataswitch></request>
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------- unlocksim.post
<request><OperateType>0</OperateType><CurrentPin>0000</CurrentPin><NewPin></NewPin><PukCode></PukCode></request>
----------------------------------------------------------------------------------------------------------------------------------------------------------

--
S pozdravom Jakub Janco
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list