how to make index.php file show connection status

I would like to create a website to show connection status for anyone who connects to the webserver.
This website would be running on my webserver located at

I was thinking to make an index.php file that could have some code in it that would execute a two bash commands:
ping if packets are being returned print “connected to local network.
ping if packets are being returned show “connected to internet”.

I was wondering if anyone could tell me if this is possible to do.

Source: bash

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.