Coder Social home page Coder Social logo

wireguard-watchdog's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.