mirror of
https://github.com/byReqz/probehost2.git
synced 2024-11-24 15:34:54 +00:00
fix command order if host is invalid but port proper
This commit is contained in:
parent
871fe76df5
commit
a0e42d369a
3
main.go
3
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
|
||||
|
Loading…
Reference in New Issue
Block a user