Last active
September 23, 2020 19:53
-
-
Save tcaddy/2e8a71da0966b9b972d8255a285f09c4 to your computer and use it in GitHub Desktop.
ping_gateway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# See https://serverfault.com/a/31179 | |
gateway=$(route -n | grep 'UG[ \t]' | awk '{print $2}') | |
echo "Pinging Gateway IP: $gateway" | |
echo "Press CTRL + C to cancel" | |
ping $gateway |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this on Ubuntu on my laptop to keep wireless from going to sleep / power save.
Also nice to run on OpenWRT routes to make sure ISP is pingable.
Also nice to run on my Raspberry Pi Zero to keep it responsive on the network.