Skip to content

A simple shell script that allows you to manage all your WireGuard VPN tunnels in one place.

License

Notifications You must be signed in to change notification settings

bWlrYQ/wg-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

WireGuard Manager

A simple shell script that allows you to manage all your WireGuard VPN tunnels in one place.
Report Bug · Request Feature

Description

This script aims to manage WireGuard VPN tunnels on a host that often needs to switch VPN because wg-quick <up/down> wg-qucik@<if>.service takes too much time 🕰️. The only thing you have to do is manage your list of VPN tunnels in vpn_config.sh.

usage

Installation

  1. Clone the repository into /opt
git clone https://github.com/bWlrYQ/wg-manager /opt/wg-manager
  1. Change script permissions
sudo chmod 711 /opt/wg-manager/vpn.sh
  1. Create a symbolic link in /usr/bin
sudo ln -sv /opt/wg-manager/vpn.sh /usr/bin/wg-manager
  1. Create a vpn_config.sh file
sudo touch /opt/wg-manager/vpn_config.sh && sudo chmod 711 /opt/wg-manager/vpn_config.sh
  1. Add your VPN list array in vpn_config.sh
bash -c 'cat << EOF > /opt/wg-manager/vpn_config.sh
#!/usr/bin/env bash

declare -A VPNS

CONFIG_FILES=(
    "/home/user/Documents/homelab.conf"
    "/etc/wireguard/work-vpn.conf"
    "/root/Downloads/external-vpn.conf"
)

INDEX=1
for CONFIG in "${CONFIG_FILES[@]}"; do
    VPN_NAME=$(basename "$CONFIG" .conf)
    VPNS["$INDEX"]="$VPN_NAME:$CONFIG"
    ((INDEX++))
done
EOF'

Usage

Simply launch the script using sudo wg-manager and answer the prompts accordingly to your needs, KISS.

License

Distributed under the GNU GPL V3.0 License. See LICENSE for more information.

About

A simple shell script that allows you to manage all your WireGuard VPN tunnels in one place.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages