How to detect an internet deconnection?

Hi Jeremy,
I tested the suggestion of @RonnyW and it works using NetScan with my own internet IP address, but not with f.i. 8.8.8.8
I pulled the plug from my internet wall outlet to simulate it.