mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-29 13:51:51 +02:00
cmd/ctrld: include DNS in interface list
This commit is contained in:
1 parent
1f2bd90308
commit
99b0cbedc3
2 files changed
+7
-2
No files matched your search
@@ -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 {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user