You're not going to want to keep wgetting infinitly to know if you have network:
what you are looking for is a "post-up" script. This is kinda advanced, but you should be able to do this.
First, figure out how to make a sound. You can use the methods @iUngi uses, like
echo -e or
To actually add this beeping to the point where you have network, use the information at https://wiki.ubuntu.com/OnNetworkConnectionRunScript
The part you are interested in (but read the whole thing!) is this:
Edit the text configuration file /etc/network/interfaces and add one
of the following directive pre-up , post-up , pre-down , post-down to
the appropriate network connection, for example :
iface eth0 inet dhcp
restart your network:
You can obviously add an extra check ping for instance or just get the headers (
curl --head) if your connection isn't always on internet but can be a local connection (and you don't want a beep then), but I think that shouldn't be needed in all cases.