Terminal script to sound alarm when an IP address is reachable again

Two scripts to warn you when either an address is UP or DOWN.

Alarm when address is reachable (good if the box or your internet connection is down):

This script sounds an alarm when it does not connect to an address: