mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
machinectl: split OS field in two; print ip addresses (#4058)
This splits the OS field in two : one for the distribution name and one for the the version id. Dashes are written for missing fields. This also prints ip addresses of known machines. The `--max-addresses` option specifies how much ip addresses we want to see. The default is 1. When more than one address is written for a machine, a `,` follows it. If there are more ips than `--max-addresses`, `...` follows the last address.
This commit is contained in:
committed by
Lennart Poettering
parent
c7440e7401
commit
07b0b339d6
@@ -70,6 +70,10 @@ static inline const char *empty_to_null(const char *p) {
|
||||
return isempty(p) ? NULL : p;
|
||||
}
|
||||
|
||||
static inline const char *strdash_if_empty(const char *str) {
|
||||
return isempty(str) ? "-" : str;
|
||||
}
|
||||
|
||||
static inline char *startswith(const char *s, const char *prefix) {
|
||||
size_t l;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user