#!/bin/bash
if [ -n "$1" ]
then
KeyName=$1
else
KeyName="wg0"
fi
umask 077
PrivateKey=$(wg genkey)
#wg genkey > $KeyName.key
#wg pubkey < $KeyName.key > $KeyName.pub
PublicKey=$(echo $PrivateKey | wg pubkey )
echo $PrivateKey > $KeyName.key
echo $PublicKey > $KeyName.pub
