Yup, it works!
Got the script running in one terminal window
Opened another terminal window and pinged the router....
64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=3.104 ms
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=3.772 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=2.817 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=2.695 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=3.800 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=2.729 ms
64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=4.074 ms
64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=2.976 ms
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=3.743 ms
64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=3.459 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=2.629 ms
64 bytes from 192.168.0.1: icmp_seq=11 ttl=64 time=2.755 ms
64 bytes from 192.168.0.1: icmp_seq=12 ttl=64 time=3.947 ms
64 bytes from 192.168.0.1: icmp_seq=13 ttl=64 time=3.723 ms
64 bytes from 192.168.0.1: icmp_seq=14 ttl=64 time=2.666 ms
64 bytes from 192.168.0.1: icmp_seq=15 ttl=64 time=2.812 ms
64 bytes from 192.168.0.1: icmp_seq=16 ttl=64 time=3.084 ms
64 bytes from 192.168.0.1: icmp_seq=17 ttl=64 time=3.912 ms
64 bytes from 192.168.0.1: icmp_seq=18 ttl=64 time=2.689 ms
64 bytes from 192.168.0.1: icmp_seq=19 ttl=64 time=2.628 ms
64 bytes from 192.168.0.1: icmp_seq=20 ttl=64 time=2.770 ms
64 bytes from 192.168.0.1: icmp_seq=21 ttl=64 time=2.568 ms
64 bytes from 192.168.0.1: icmp_seq=22 ttl=64 time=2.790 ms
64 bytes from 192.168.0.1: icmp_seq=23 ttl=64 time=2.685 ms
64 bytes from 192.168.0.1: icmp_seq=24 ttl=64 time=2.535 ms
64 bytes from 192.168.0.1: icmp_seq=25 ttl=64 time=5.268 ms
64 bytes from 192.168.0.1: icmp_seq=26 ttl=64 time=2.549 ms
64 bytes from 192.168.0.1: icmp_seq=27 ttl=64 time=2.899 ms
64 bytes from 192.168.0.1: icmp_seq=28 ttl=64 time=4.504 ms
64 bytes from 192.168.0.1: icmp_seq=29 ttl=64 time=4.286 ms
64 bytes from 192.168.0.1: icmp_seq=30 ttl=64 time=2.286 ms
64 bytes from 192.168.0.1: icmp_seq=31 ttl=64 time=3.552 ms
64 bytes from 192.168.0.1: icmp_seq=32 ttl=64 time=2.686 ms
64 bytes from 192.168.0.1: icmp_seq=33 ttl=64 time=3.241 ms
64 bytes from 192.168.0.1: icmp_seq=34 ttl=64 time=2.506 ms
64 bytes from 192.168.0.1: icmp_seq=35 ttl=64 time=2.906 ms
64 bytes from 192.168.0.1: icmp_seq=36 ttl=64 time=2.406 ms
64 bytes from 192.168.0.1: icmp_seq=37 ttl=64 time=2.761 ms
64 bytes from 192.168.0.1: icmp_seq=38 ttl=64 time=3.290 ms
64 bytes from 192.168.0.1: icmp_seq=39 ttl=64 time=2.594 ms
64 bytes from 192.168.0.1: icmp_seq=40 ttl=64 time=5.635 ms
64 bytes from 192.168.0.1: icmp_seq=41 ttl=64 time=2.995 ms
64 bytes from 192.168.0.1: icmp_seq=42 ttl=64 time=3.353 ms
64 bytes from 192.168.0.1: icmp_seq=43 ttl=64 time=2.543 ms
64 bytes from 192.168.0.1: icmp_seq=44 ttl=64 time=4.125 ms
64 bytes from 192.168.0.1: icmp_seq=45 ttl=64 time=2.357 ms
64 bytes from 192.168.0.1: icmp_seq=46 ttl=64 time=2.571 ms
64 bytes from 192.168.0.1: icmp_seq=47 ttl=64 time=3.355 ms
64 bytes from 192.168.0.1: icmp_seq=48 ttl=64 time=2.540 ms
64 bytes from 192.168.0.1: icmp_seq=49 ttl=64 time=2.885 ms
64 bytes from 192.168.0.1: icmp_seq=50 ttl=64 time=2.603 ms
64 bytes from 192.168.0.1: icmp_seq=51 ttl=64 time=3.181 ms
64 bytes from 192.168.0.1: icmp_seq=52 ttl=64 time=2.676 ms
BEFORE I did this, it looked like this:
64 bytes from 192.168.0.1: icmp_seq=389 ttl=64 time=129.404 ms
64 bytes from 192.168.0.1: icmp_seq=390 ttl=64 time=2.272 ms
64 bytes from 192.168.0.1: icmp_seq=391 ttl=64 time=72.284 ms
64 bytes from 192.168.0.1: icmp_seq=392 ttl=64 time=98.707 ms
64 bytes from 192.168.0.1: icmp_seq=393 ttl=64 time=17.089 ms
64 bytes from 192.168.0.1: icmp_seq=394 ttl=64 time=38.161 ms
64 bytes from 192.168.0.1: icmp_seq=395 ttl=64 time=60.997 ms
64 bytes from 192.168.0.1: icmp_seq=396 ttl=64 time=2.428 ms
64 bytes from 192.168.0.1: icmp_seq=397 ttl=64 time=3.965 ms
64 bytes from 192.168.0.1: icmp_seq=398 ttl=64 time=26.902 ms
64 bytes from 192.168.0.1: icmp_seq=399 ttl=64 time=49.749 ms
64 bytes from 192.168.0.1: icmp_seq=400 ttl=64 time=72.530 ms
64 bytes from 192.168.0.1: icmp_seq=401 ttl=64 time=9.322 ms
64 bytes from 192.168.0.1: icmp_seq=402 ttl=64 time=18.839 ms
64 bytes from 192.168.0.1: icmp_seq=403 ttl=64 time=93.281 ms
64 bytes from 192.168.0.1: icmp_seq=404 ttl=64 time=88.092 ms
64 bytes from 192.168.0.1: icmp_seq=405 ttl=64 time=84.305 ms
64 bytes from 192.168.0.1: icmp_seq=406 ttl=64 time=4.639 ms
64 bytes from 192.168.0.1: icmp_seq=407 ttl=64 time=27.435 ms
64 bytes from 192.168.0.1: icmp_seq=408 ttl=64 time=50.764 ms
64 bytes from 192.168.0.1: icmp_seq=409 ttl=64 time=72.992 ms
64 bytes from 192.168.0.1: icmp_seq=410 ttl=64 time=95.775 ms
64 bytes from 192.168.0.1: icmp_seq=411 ttl=64 time=15.884 ms
64 bytes from 192.168.0.1: icmp_seq=412 ttl=64 time=38.834 ms
64 bytes from 192.168.0.1: icmp_seq=413 ttl=64 time=61.455 ms
Blimey.