A shell script to check and log when your internet connection goes down, by @TristanBrotherton – Find his project here
Now this script runs in a Docker container.
This container runs a shell script that:
- Checks your internet connection every 5 seconds (via
pingtogoogle.com) - Logs connection losses and recoveries with timestamps
- Optionally performs speed tests at startup and after each reconnect
- Serves a basic web interface showing log output via a lightweight Python web server
git clone https://github.com/r00xat/netcheck-docker.git
cd netcheck-docker
docker build -t netcheck:own .docker run -p 9000:9000 --name netcheck_monitor netcheck:owndocker run -d -p 9000:9000 --name netcheck_monitor netcheck:owndocker logs netcheck_monitorUse this to view the output of the script while it's running in the background.
version: '3.8'
services:
netcheck:
image: netcheck:own # Adjust if your image has a different name/tag
container_name: netcheck_monitor # Optional but descriptive
restart: always
ports:
- "9000:9000" # Maps host port 9000 to container port 9000
environment:
TZ: "Europe/Vienna" # Set the timezone; see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
NETCHECK_DISABLE_SPEEDTEST: "true" # If true, disables speed tests after reconnect/startThis containerized version is based on the original project by @TristanBrotherton.
Find the original script here: TristanBrotherton/netcheck
This project is licensed under the Apache-2.0 License.
➕ For a detailed list of changes made compared to the original project, see MODIFICATIONS.md.