Skip to content

Instantly share code, notes, and snippets.

View ccimpoi's full-sized avatar

Cosmin Ioan Cimpoi ccimpoi

View GitHub Profile
@ccimpoi
ccimpoi / gist:d120ace06831a4f8f1c338e585b4bdcd
Created November 2, 2020 12:24
ISP connection monitor with ping every 10 sec and print date time it fails
while true; do if [[ $(ping -c 1 8.8.8.8 2>&1 | grep "1 packets received" | wc -c) -eq 0 ]]; then echo $(date); fi; sleep 10; done
cmdRes=$(/usr/bin/curl -s --request POST "https://wap.tplinkcloud.com/?token=$TOKEN HTTP/1.1" \
--header "Content-Type: application/json" \
--data @- << REQUEST_BODY
{
"method":"passthrough",
"params": {
"deviceId": "$DEVICE_ID",
"requestData": "{\"system\":{\"get_sysinfo\":null},\"emeter\":{\"get_realtime\":null}}"
}
}

Keybase proof

I hereby claim:

  • I am binarycrafts on github.
  • I am ccimpoi (https://keybase.io/ccimpoi) on keybase.
  • I have a public key ASCL6TOzQWdLg5yq724W3lLf7H0ExSszTMlwv8Dn2rJ3awo

To claim this, I am signing this object: