Git Product home page Git Product logo

exec_after_vpn's Introduction

Run Custom Scripts After Establishing VPN Connection

logo

Note: Currently this only works with NordVPN, and you must have an active subscription

Allows for execution of arbitrary scripts after the OpenVPN connection has been established with the server.

Quick Start

Update your NordVPN username and password in the openvpn.sh file.

Next, replace helper.sh with your own script, but keep the name as helper.sh.

Scripts are pasted to /etc/scripts/ directory within the Docker container.

If you have multiple scripts to run in succession, then you can control the order of execution via the helper script. make sure to chmod +x your scripts in either openvpn.sh or helper.sh to avoid issues with execution.

Next, build the docker image and tag it a name you'd like. I'm going to use exec_after_vpn

docker build -t exec_after_vpn .

Now you are ready to run the image you just built. Note in order for OpenVPN to create the tun device you would have to run the container as --privileged

docker run --rm --privileged exec_after_vpn

Python Script Dependencies

The container runs python 3.6; however, if you have dependencies, specify them in the requirements.txt file in docker_scripts folder prior to building the container.

Bash Script Dependencies

Append the line below in Dockerfile to install the binaries you need.

apt-get install -y --force-yes openvpn wget unzip curl procps ANYTHING_ELSE_YOU_NEED && \

Author

  • Victor Xu

License

MIT

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.