cmd/ctrld: include DNS in interface list

This commit is contained in:
Cuong Manh Le authored and Cuong Manh Le committed 2023-01-20 21:43:04 +07:00
1 parent 1f2bd90308
commit 99b0cbedc3
2 files changed
+7 -2

No files matched your search

+7
View File
@@ -340,6 +340,13 @@ func initCLI() {
} }
fmt.Printf(" %v\n", ipaddr) fmt.Printf(" %v\n", ipaddr)
} }
for i, dns := range currentDNS(i.Interface) {
if i == 0 {
fmt.Printf("DNS : %s\n", dns)
continue
}
fmt.Printf(" : %s\n", dns)
}
println() println()
}) })
if err != nil { if err != nil {
-2
View File
@@ -3,7 +3,6 @@ package main
import ( import (
"bufio" "bufio"
"bytes" "bytes"
"fmt"
"net" "net"
"net/netip" "net/netip"
"os/exec" "os/exec"
@@ -85,7 +84,6 @@ func getDNSByResolvectl(iface string) []string {
} }
parts = strings.Fields(parts[0]) parts = strings.Fields(parts[0])
if len(parts) > 2 { if len(parts) > 2 {
fmt.Println(parts)
return parts[3:] return parts[3:]
} }
return nil return nil