Skip to content

Starlexxx/wireguard-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

WireGuard Configuration Script

This script is used to generate WireGuard configurations for users and create QR codes for the configurations.

Installation

# Download the script from GitHub:  
curl -o wg-gen https://raw.githubusercontent.com/Starlexxx/wireguard-generator/main/wg-gen.sh

# Make the script executable:  
chmod +x wg-gen

# Move the script to a directory in your PATH, for example /usr/local/bin:  
sudo mv wg-gen /usr/local/bin/

# Add the following line to your .bashrc or .bash_profile to ensure the script is in your PATH:  
export PATH=$PATH:/usr/local/bin

# Reload your shell configuration:  
source ~/.bashrc

Usage

wg-gen {server|add|qr} -n <username> [-qr]

Commands

wg-gen server # Install WireGuard and configure the server.
wg-gen add -n <username> [-qr] # Generate a new WireGuard configuration for the specified user.
wg-gen qr -n <username> # Generate a QR code for the specified user's WireGuard configuration.
wg-gen help # Display the help message.

Examples

Install WireGuard and configure the server:

wg-gen server

Generate a WireGuard configuration for a user:

wg-gen add -n Starlexxx

Generate a QR code for the WireGuard configuration of a user named Andrew:

wg-gen qr -n Starlexxx

Generate a WireGuard configuration for a user and a QR code:

wg-gen add -n Starlexxx -qr

Dependencies

wg: WireGuard command-line tool. qrencode: Tool to generate QR codes.

Make sure these dependencies are installed and available in your system's PATH.

Notes

The script assumes that the WireGuard configuration directory is /etc/wireguard. The WireGuard interface is assumed to be wg0. User configurations are stored in /etc/wireguard/users.

About

Generates wireguard configs and qr codes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages