dnsleaktest.sh and BustBox
Hi, BusyBox doesnt work the same like bash. Therefore some are changes necessary:
Line 50 changed: for i in {1..10};do -> for i in $(seq 1 10); do
Line 57 added: echo ${result} | \
Line 59 changed: ".[] | select(.type == \"${1}\") | \"\(.ip)\(if .country_name != \"\" and .country_name != false then \" [\(.country_name)\(if .asn != \"\" and .asn != false then \" \(.asn)\" else \"\" end)]\" else \"\" end)\"" \ -> ".[] | select(.type == \"${1}\") | \"\(.ip)\(if .country_name != \"\" and .country_name != false then \" [\(.country_name)\(if .asn != \"\" and .asn != false then \" \(.asn)\" else \"\" end)]\" else \"\" end)\""
Line 60 removed: <<< ${result}
Line 67 changed: dns_count=$(jq 'map(select(.type == "dns")) | length' <<< ${result}) -> echo ${result}) | dns_count=$(jq 'map(select(.type == "dns")) | length'
Line 81 changed: jq --monochrome-output --raw-output '.[] | select(.type == "conclusion") | .ip' <<< ${result} -> echo ${result} | jq --monochrome-output --raw-output '.[] | select(.type == "conclusion") | .ip'
Cosmetical changes but they allow to run the script on small routers.
Regards, Piotr
I don't see the changes in line 59, please check
Well, have a look at final \ which has been removed. Simply I have added one line at the top (#57), removed final line (#60) and modified line #59 to be the last one.
I've made the fix, please test it on BusyBox. And let me know about results
https://github.com/macvk/dnsleaktest/blob/master/dnsleaktest.sh