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

Fix duplicated output produced by scutil

This commit is contained in:
lucus 2018-06-04 20:58:44 +09:00
parent f9db4cc990
commit 4e93b040bc

View File

@ -42,7 +42,7 @@ func dnsLinux() []string {
} }
func dnsMacOS() []string { func dnsMacOS() []string {
cmdString := `scutil --dns | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'` 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) cmd := exec.Command("sh", "-c", cmdString)
out := wtf.ExecuteCommand(cmd) out := wtf.ExecuteCommand(cmd)