1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
Better handle dns on macOS
This commit is contained in:
lucus 2018-06-04 17:40:02 +09:00
parent 5ff80f309a
commit f9db4cc990

View File

@ -42,7 +42,8 @@ func dnsLinux() []string {
}
func dnsMacOS() []string {
cmd := exec.Command("networksetup", "-getdnsservers", "Wi-Fi")
cmdString := `scutil --dns | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'`
cmd := exec.Command("sh", "-c", cmdString)
out := wtf.ExecuteCommand(cmd)
lines := strings.Split(out, "\n")