cleanup nping commands

This commit is contained in:
Nils 2022-05-29 14:26:09 +02:00
parent 955f1253af
commit 2b8510c5ee
Signed by: byreqz
GPG Key ID: 396A62D7D436749E

10
main.go
View File

@ -151,13 +151,13 @@ func prerunner(req *http.Request, cmd string, cmdopts map[string]string, default
remoteaddr = req.RemoteAddr remoteaddr = req.RemoteAddr
} }
for i, host := range hosts { for i, host := range hosts {
runargs := append(args, opts...)
if ports[i] != "0" && cmd == "nping" { if ports[i] != "0" && cmd == "nping" {
args = append(args, "-p"+ports[i]) runargs = append(runargs, "-p"+ports[i])
} }
args = append(args, opts...) runargs = append(runargs, host)
args = append(args, host) fmt.Println(remoteaddr, cmd, runargs)
fmt.Println(remoteaddr, cmd, args) res = fmt.Sprint(res, runner(remoteaddr, cmd, runargs...), "\n")
res = fmt.Sprint(res, runner(remoteaddr, cmd, args...), "\n")
} }
return res return res
} }