http://infodotnet.blogspot.it/2011/01/simple-bash-script-to-check-and-auto.html