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.
goto out;
}
- START_COLOR("color_good");
+ if (BEGINS_WITH(ip_address, "no IP"))
+ START_COLOR("color_degraded");
+ else
+ START_COLOR("color_good");
for (walk = format_up; *walk != '\0'; walk++) {
if (*walk != '%') {
if (info.flags & WIRELESS_INFO_FLAG_HAS_QUALITY)
START_COLOR((info.quality < info.quality_average ? "color_degraded" : "color_good"));
else
- START_COLOR("color_good");
+ START_COLOR((BEGINS_WITH(ip_address, "no IP") ? "color_degraded" : "color_good"));
} else {
walk = format_down;
START_COLOR("color_bad");