Determine IP address of gateway

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Determine IP address of gateway

Dr Eberhard Lisse

I want code to run on my laptop depending on what WiFi I am connected to
(ie internally I access MySQL without password, externally with
password). Currently I look for the gateway and then branch accordingly.

Is there any way of doing

gateway = system("netstat -r -f inet -n|grep default|awk '{print $2}'",
intern = T)

within R other than running it as a system() call?

greetings, el

[hidden email] mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.