I'm writing some setup scripts/documentation and I want to dynamically set the listen ip for a service, given that I know that a particular network interface will be on a particular network. There are a bunch services on my network that I'd like to configure this way, so I hope that this will streamline my work a (tiny) bit.
I know that can do this by parsing incantations of ifconfig
, ip
, etc, but I'm wondering if this is the canonical solution.