Add script to generate Wireguard keys

This commit is contained in:
coolneng 2021-07-31 22:20:54 +01:00
parent bd880608c5
commit 1270925d3f
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 15 additions and 0 deletions

15
vpn-client.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
usage() {
echo "Usage: vpn-client.sh <hostname>"
echo "hostname: Name of the new host"
exit 1
}
if [ $# != 1 ]; then
usage
fi
hostname=$1
wg genkey | tee "$hostname".key | wg pubkey >"$hostname".pub