fix command order if host is invalid but port proper

This commit is contained in:
Nils 2022-05-29 15:07:01 +02:00
parent 871fe76df5
commit a0e42d369a
Signed by: byreqz
GPG Key ID: 396A62D7D436749E

View File

@ -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