diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2010-02-14 12:49:03 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2010-02-14 12:49:03 +0100 |
commit | 3eec92d504444ad4f0c59b42ea961a3dedd9ebc2 (patch) | |
tree | 21a5d387fac192536d5a3038ac84a10ab1aadadc /src | |
parent | 18c4b9866d395720077e815d85755a8ac54354ca (diff) |
Colorize ethernet output (patch by Peter Johnson)
Diffstat (limited to 'src')
-rw-r--r-- | src/print_eth_info.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/print_eth_info.c b/src/print_eth_info.c index 1da0502..9ad9b92 100644 --- a/src/print_eth_info.c +++ b/src/print_eth_info.c @@ -79,8 +79,12 @@ void print_eth_info(const char *interface, const char *format_up, const char *fo const char *ip_address = get_ip_addr(interface); if (ip_address == NULL) { + printf("%s", color("#FF0000")); printf("%s", format_down); + (void)printf("%s", endcolor()); return; + } else { + printf("%s", color("#00FF00")); } for (walk = format_up; *walk != '\0'; walk++) { @@ -97,4 +101,6 @@ void print_eth_info(const char *interface, const char *format_up, const char *fo walk += strlen("speed"); } } + + (void)printf("%s", endcolor()); } |