On Fri, 2012-05-04 at 23:35 -0600, Philip Prindeville wrote: > > -find_gw() { > > - route -n | awk '$1 == "0.0.0.0" { print $2; exit }' > > +find_route() { > > + ip route get $1 | sed -e 's/ /\n/g' | \ > > + sed -ne '1p;/via/{N;p};/dev/{N;p};/src/{N;p};/mtu/{N;p}' > > I'd (a) use "ip -4 -o" instead of piping through sed to remove > newlines, and (b) use awk munge the fields into the output.
Care to express that in 'diff -up' form? Note that it's not "ip -4"; this doesn't just work for Legacy IP. It works when the VPN server is on IPv6 too, and I've tested it that way (in the openconnect incantation at least; I haven't done PPTP). -- dwmw2
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel