I don't expect anybody to read this. I'm just storing these notes in the cloud so I find them again. Easier than storing them on my machine, where I might lose them.
I'm building an 'evil-twin' script. It needs to find out which adapter (like eth0 or wlan0) I'm going to use as my upstream side, that will connect to the Internet. It also needs the gateway IP address.
The way to do that is with the route -n command (netstat -rn also works), then extract the data with grep and awk:
Hlw
ReplyDelete