summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-12 19:11:35 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-12 19:11:35 +0100
commitb1acce80cd60fe95f16df2f1ad23ff2ad82d08e5 (patch)
tree80ad366ac452500608e3c45c29f4ae2fcef38a0a /src
parent1693a943ca581aca2beebb4c812ec6c9f17b8164 (diff)
networkctl: also draw a nice unicode cirlce when "networkctl status" is run without parameters
Diffstat (limited to 'src')
-rw-r--r--src/network/networkctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 3760de71dd..a2511fd566 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -580,9 +580,6 @@ static int link_status_one(
sprintf(devid, "n%i", ifindex);
d = udev_device_new_from_device_id(udev, devid);
-
- link_get_type_string(iftype, d, &t);
-
if (d) {
link = udev_device_get_property_value(d, "ID_NET_LINK_FILE");
driver = udev_device_get_property_value(d, "ID_NET_DRIVER");
@@ -597,6 +594,8 @@ static int link_status_one(
model = udev_device_get_property_value(d, "ID_MODEL");
}
+ link_get_type_string(iftype, d, &t);
+
sd_network_link_get_network_file(ifindex, &network);
printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
@@ -676,7 +675,9 @@ static int link_status(char **args, unsigned n) {
sd_network_get_operational_state(&operational_state);
operational_state_to_color(operational_state, &on_color_operational, &off_color_operational);
- printf(" State: %s%s%s\n", on_color_operational, strna(operational_state), off_color_operational);
+ printf("%s%s%s State: %s%s%s\n",
+ on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational,
+ on_color_operational, strna(operational_state), off_color_operational);
dump_addresses(rtnl, " Address: ", 0);
dump_gateways(rtnl, hwdb, " Gateway: ", 0);