All,
Both iwconfig and ifconfig will give you the name of both your wired and wifi connections, if available. Wondering if there is, in some BASH libraries, a script that extracts the wired name if passed "lan" as an input var, or wifi name if passed "wifi" as the input var.
I currently have 2 scripts named 1.) lan-start.sh, 2.) wifi-start.sh. I wrote both of these over 5 years back when 'eth0' was always the wired connection and wlan0 was always the wifi connection. Can't use those anymore.
Want to simplify with one 'netw-start.sh' script that I can pass the "lan" or "wifi" options and it will:
- Extract the appropriate connection name,
- Restart the connection,
- Start DHCP
- Ping Goog 3 times to confirm successful connect.
An additional option would be to lookup the router UID/PWD in a file and get the router status, reporting if the router is down or in need of restart.
Cheers!
TBNK