use cobra args, not os.Args

This commit is contained in:
Steven Polley 2024-04-10 21:51:00 -06:00
parent 291cbaabd4
commit 3ff47dfa19

View File

@ -46,7 +46,7 @@ Example usage:
// Transmit
fmt.Println("Transmitting knock sequence:", ports)
for _, port := range ports {
conn, _ := net.Dial("udp", fmt.Sprintf("%s:%d", os.Args[1], port))
conn, _ := net.Dial("udp", fmt.Sprintf("%s:%d", args[0], port))
conn.Write([]byte{0})
conn.Close()
time.Sleep(time.Millisecond * 200) // TBD: Make this configurable with flag (maxJitter)