Open BlessJah opened 7 years ago
I'd accept a PR for this, as long as it falls back to parsing ip address
output, so that non-DigitialOcean systems still work, although I'm not really convinced the parsing is any more error-prone than using a ReST API, my reasoning being that ip address
output is always going to be there and probably never going to change format, whereas a hardcoded host address and path could very well change or fail in some novel way.
The lines could otherwise be beautified by using a few bash functions that call each other.
Parsing
ip
output is error prone and provides lot of unnecessary duplication. All the data that is necessary to configure should be (and in fact is) provided by means of droplet metadata, exposed via convenient REST API.Existence and lack of specific keys gives one great inspection abilities with minimal effort.
The
interfaces
endpoint contains precise information on amount and intention of interfaces: