]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolvectl: show current DNS server only when it is set 8966/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 May 2018 07:12:57 +0000 (16:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 May 2018 07:12:57 +0000 (16:12 +0900)
src/resolve/resolvectl.c

index cec8fc31b262cf8136a0d8f2691cb9d4fc450201..10665a7e04d0b415220fa6fde38c9cb241ee4185 100644 (file)
@@ -1457,13 +1457,14 @@ static int status_ifindex(sd_bus *bus, int ifindex, const char *name, StatusMode
         printf("       LLMNR setting: %s\n"
                "MulticastDNS setting: %s\n"
                "      DNSSEC setting: %s\n"
-               "    DNSSEC supported: %s\n"
-               "  Current DNS Server: %s\n",
+               "    DNSSEC supported: %s\n",
                strna(link_info.llmnr),
                strna(link_info.mdns),
                strna(link_info.dnssec),
-               yes_no(link_info.dnssec_supported),
-               strna(link_info.current_dns));
+               yes_no(link_info.dnssec_supported));
+
+        if (link_info.current_dns)
+                printf("  Current DNS Server: %s\n", link_info.current_dns);
 
         STRV_FOREACH(i, link_info.dns) {
                 printf("         %s %s\n",
@@ -1684,13 +1685,14 @@ static int status_global(sd_bus *bus, StatusMode mode, bool *empty_line) {
         printf("       LLMNR setting: %s\n"
                "MulticastDNS setting: %s\n"
                "      DNSSEC setting: %s\n"
-               "    DNSSEC supported: %s\n"
-               "  Current DNS Server: %s\n",
+               "    DNSSEC supported: %s\n",
                strna(global_info.llmnr),
                strna(global_info.mdns),
                strna(global_info.dnssec),
-               yes_no(global_info.dnssec_supported),
-               strna(global_info.current_dns));
+               yes_no(global_info.dnssec_supported));
+
+        if (global_info.current_dns)
+                printf("  Current DNS Server: %s\n", global_info.current_dns);
 
         STRV_FOREACH(i, global_info.dns) {
                 printf("         %s %s\n",