1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge pull request #151 from lixin9311/dns-macos

Fix issue #89
This commit is contained in:
Chris Cummer 2018-06-04 20:59:40 -07:00 committed by GitHub
commit 15b4934f16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,8 @@ func dnsLinux() []string {
}
func dnsMacOS() []string {
cmd := exec.Command("networksetup", "-getdnsservers", "Wi-Fi")
cmdString := `scutil --dns | head -n 7 | 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")