Last active
May 9, 2016 05:57
-
-
Save tarrsalah/e3e3d3cfca61df25ecda7f1a490c8b35 to your computer and use it in GitHub Desktop.
invalidate my ARP cache every 500ms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os/exec" | |
"time" | |
) | |
func inarp() { | |
cmd := exec.Command("/bin/sh", "-c", "sudo ip -s -s neigh flush all") | |
stdout, err := cmd.Output() | |
if err != nil { | |
println(err.Error()) | |
return | |
} | |
print(string(stdout)) | |
} | |
func main() { | |
for _ = range time.Tick(500 * time.Millisecond) { | |
inarp() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment