leafoliage / freebsd-dockerbox

Use Linux to drive your dockerd (Inspired by pgj/freebsd-wifibox)
BSD 2-Clause "Simplified" License
15 stars 4 forks source link

Switch from netstat to route to get network interface #7

Closed ComputerCraftr closed 2 months ago

ComputerCraftr commented 3 months ago

Hi,

I noticed that netstat -nr | grep default | awk '{ print $4 }' returns multiple lines on my system by grabbing the default routes from the separate IPv4 and IPv6 routing tables, which broke the installation script for me. I replaced it with route -n get -inet default | grep 'interface:' | awk '{ print $2 }' which returns the interface of the default route from the IPv4 routing table and this resolved the issue.

leafoliage commented 2 months ago

Thank you so much! It looks great :D (Sorry for the slow reply. I was a bit distracted last weeks)