A simple shell script that allows you to manage all your WireGuard VPN tunnels in one place.
Report Bug
·
Request Feature
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
.
- Clone the repository into
/opt
git clone https://github.com/bWlrYQ/wg-manager /opt/wg-manager
- Change script permissions
sudo chmod 711 /opt/wg-manager/vpn.sh
- Create a symbolic link in
/usr/bin
sudo ln -sv /opt/wg-manager/vpn.sh /usr/bin/wg-manager
- Create a
vpn_config.sh
file
sudo touch /opt/wg-manager/vpn_config.sh && sudo chmod 711 /opt/wg-manager/vpn_config.sh
- 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'
Simply launch the script using sudo wg-manager
and answer the prompts accordingly to your needs, KISS.
Distributed under the GNU GPL V3.0 License. See LICENSE
for more information.