Skip to content

Instantly share code, notes, and snippets.

@olekstomek
Last active December 27, 2021 15:17
Show Gist options
  • Save olekstomek/a85152fca24adfde05b44e957a8f5180 to your computer and use it in GitHub Desktop.
Save olekstomek/a85152fca24adfde05b44e957a8f5180 to your computer and use it in GitHub Desktop.
skrypt do pokazywania parametrów sygnału w modemie mobilnym 4G
#!/bin/sh
HOST=192.168.32.1
PASSWORD=admin
HEADER="Referer: http://$HOST/index.html"
P=$(echo -n "$PASSWORD" | base64 -w0 | sha256sum | awk '{print toupper($1)}')
A=$(wget -t 3 -q -O - --save-cookies cookies.txt --keep-session-cookies --header="$HEADER" --post-data "isTest=false&goformId=LOGIN&password=$P" http://$HOST/goform/goform_set_cmd_process)
if [ "x$A" = "x{\"result\":\"0\"}" ]; then
A=$(wget -t 3 -q -O - --load-cookies cookies.txt --header="$HEADER" "http://$HOST/goform/goform_get_cmd_process?isTest=false&cmd=network_type%2Crssi%2Crscp%2Clte_rsrp%2Cwan_lte_ca%2Clte_ca_pcell_band%2Clte_ca_pcell_bandwidth%2Clte_ca_scell_band%2Clte_ca_scell_bandwidth%2Clte_ca_pcell_arfcn%2Clte_ca_scell_arfcn%2CZ_SINR%2CZ_CELL_ID%2CZ_eNB_id%2CZ_rsrq%2Clte_ca_scell_info%2Cwan_ipaddr%2Cipv6_wan_ipaddr%2Cstatic_wan_ipaddr%2Copms_wan_mode%2Copms_wan_auto_mode%2Cppp_status%2Cloginfo&multi_data=1")
fi
if command -v jq >/dev/null; then
echo $A | jq .
else
echo $A
fi
exit 0
@olekstomek
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment