mirror of https://github.com/statping/statping
Merge pull request #623 from zeeZ/bugfix/602-icmp-broken
separate command options and option argumentspull/655/head
commit
45a04941e0
|
@ -4,9 +4,9 @@ package utils
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
@ -41,7 +41,7 @@ func Ping(address string, secondsTimeout int) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out, _, err := Command(ping, address, "-c 1", fmt.Sprintf("-W %v", secondsTimeout))
|
||||
out, _, err := Command(ping, address, "-c", "1", "-W", strconv.Itoa(secondsTimeout))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package utils
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -30,7 +30,7 @@ func Ping(address string, secondsTimeout int) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out, _, err := Command(ping, address, "-n 1", fmt.Sprintf("-w %v", secondsTimeout*1000))
|
||||
out, _, err := Command(ping, address, "-n", "1", "-w", strconv.Itoa(secondsTimeout*1000))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue