The previous command had several downsides. Firstly, the `-I` option of
hostname is not available on older versions of the command. Secondly, even
on the latest version the order of the output ip addresses is undefined,
so we cannot rely on always taking the first address. Thirdly, sometimes
the command just returns localhost's IP (127.0.0.1) instead of a
routable IP on the network.
The new approach gets the IP address of the default interface that is
used to route requests to the outside, which gives the correct response
on all of my test machines.
Co-authored-by: Nicolas Schneider <nioncode+github@gmail.com>