From a0e42d369ab11f0db0781b9c649d412eb4af265e Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 29 May 2022 15:07:01 +0200 Subject: [PATCH] fix command order if host is invalid but port proper --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index bb86cb0..d1b3e39 100644 --- a/main.go +++ b/main.go @@ -106,6 +106,8 @@ func validatehosts(hosts []string) ([]string, []string) { } } else if _, err := net.LookupIP(host); err == nil { validhosts = append(validhosts, host) + } else { + continue } var port string @@ -156,7 +158,6 @@ func prerunner(req *http.Request, cmd string, cmdopts map[string]string, default runargs = append(runargs, "-p"+ports[i]) } runargs = append(runargs, host) - fmt.Println(remoteaddr, cmd, runargs) res = fmt.Sprint(res, runner(remoteaddr, cmd, runargs...), "\n") } return res