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
}
for i, host := range hosts {
runargs := append(args, opts...)
if ports[i] != "0" && cmd == "nping" {
args = append(args, "-p"+ports[i])
runargs = append(runargs, "-p"+ports[i])
}
args = append(args, opts...)
args = append(args, host)
fmt.Println(remoteaddr, cmd, args)
res = fmt.Sprint(res, runner(remoteaddr, cmd, args...), "\n")
runargs = append(runargs, host)
fmt.Println(remoteaddr, cmd, runargs)
res = fmt.Sprint(res, runner(remoteaddr, cmd, runargs...), "\n")
}
return res
}