From 2b8510c5ee5c16ae5883712441c6113b8c1f9bd8 Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 29 May 2022 14:26:09 +0200 Subject: [PATCH] cleanup nping commands --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 9afc992..8fb0a32 100644 --- a/main.go +++ b/main.go @@ -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 }