Skip to content

Python watchdog script for Wireguard clients that have a kill switch.

Notifications You must be signed in to change notification settings

JXGA/Wireguard-Watchdog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Wireguard Watchdog

This is a very simple Python script that requires very little configuration and has few dependencies.

This script is destined for machines that have an internet kill switch, meaning no internet access unless the Wireguard VPN is up.

The original script linked below is better for pinging IP the Wireguard server IP.

Information

This script was re-written based on a script shared on Reddit. Source is here

Where to use this script:

  • A system that uses Wireguard
  • A kill-switch that only allows internet access if the VPN is up

How to use:

  1. Copy the script to your desired destination
  2. Install requests if you don't already have it (python -m pip install requests)
  3. Check the script is suitably configured for you.
  4. Add to your root crontab (sudo crontab -e). Root access is used to restart the Wireguard service: */5 * * * * /usr/bin/python3 /home/USER/wg-watchdog.py

Options for you to change the script:

  • Use pythonping to ping a server instead of checking a website is available. Note that this library does require administrator escalation.

About

Python watchdog script for Wireguard clients that have a kill switch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages