Bash script to detect changes in internet connectivity