Use "color_degraded" when interface has no IP

On laptops one may want to have all interfaces up in order to let network
prioritization manage switching between wired and wireless connection.  In such
cases lack of IP address is a useful hint about currently used interface, and
color-coding makes it stand out more.
This commit is contained in:
Dmitrij D. Czarkoff 2015-08-06 17:14:38 +02:00
parent 15f2279592
commit 9b238a8d65
2 changed files with 5 additions and 2 deletions

View File

@ -126,7 +126,10 @@ void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, cons
goto out;
}
START_COLOR("color_good");
if (BEGINS_WITH(ip_address, "no IP"))
START_COLOR("color_degraded");
else
START_COLOR("color_good");