use go-cmd/cmd

This commit is contained in:
Jeff Carr 2024-11-08 06:42:46 -06:00
parent a4659ec595
commit 1082f0b7f9
2 changed files with 8 additions and 8 deletions

View File

@ -17,6 +17,7 @@ import (
"fmt" "fmt"
"os" "os"
"reflect" "reflect"
"strings"
"time" "time"
"go.wit.com/gui" "go.wit.com/gui"
@ -252,13 +253,13 @@ func (ds *digStatus) updateDnsStatus() {
ds.setIPv6status("Need VPN") ds.setIPv6status("Need VPN")
} }
r := shell.Output("", []string{"dig", "+noall", "+answer", "www.wit.com", "A"}) r := shell.Run([]string{"dig", "+noall", "+answer", "www.wit.com", "A"})
log.Log(DNS, "makeDnsStatusGrid() dig", r.Stdout()) log.Log(DNS, "makeDnsStatusGrid() dig", r.Stdout)
me.digStatus.set(ds.DnsDigUDP, r.Stdout()) me.digStatus.set(ds.DnsDigUDP, strings.Join(r.Stdout, "\n"))
r = shell.Output("", []string{"dig", "+noall", "+answer", "www.wit.com", "AAAA"}) r = shell.Run([]string{"dig", "+noall", "+answer", "www.wit.com", "AAAA"})
log.Log(DNS, "makeDnsStatusGrid() dig", r.Stdout()) log.Log(DNS, "makeDnsStatusGrid() dig", r.Stdout)
me.digStatus.set(ds.DnsDigTCP, r.Stdout()) me.digStatus.set(ds.DnsDigTCP, strings.Join(r.Stdout, "\n"))
/* /*
g2.NewButton("dig +trace", func () { g2.NewButton("dig +trace", func () {

3
dns.go
View File

@ -8,7 +8,6 @@ import (
"net" "net"
"strings" "strings"
"go.wit.com/lib/gui/shell"
"go.wit.com/log" "go.wit.com/log"
) )
@ -88,7 +87,7 @@ func lookupNS(domain string) {
setProvider(s) setProvider(s)
} }
} }
tmp = shell.Chomp(tmp) tmp = strings.TrimSpace(tmp)
if tmp != me.statusDNS.NSrr.String() { if tmp != me.statusDNS.NSrr.String() {
me.changed = true me.changed = true