diff options
author | Luca Albuquerque <lucalacerda1@gmail.com> | 2019-06-04 20:28:47 -0300 |
---|---|---|
committer | Luca Albuquerque <lucalacerda1@gmail.com> | 2019-06-04 20:28:47 -0300 |
commit | ed75f787b80ab1461c0348d595d6ee9c32dbff0b (patch) | |
tree | 6a17f8cf947043391ffee669943018db2d1e5b46 /wireguard-install.sh | |
parent | 7e71ea7dbb5a3962daea8abee065fd550ade31b8 (diff) |
Add symmetric key option
Diffstat (limited to 'wireguard-install.sh')
-rw-r--r-- | wireguard-install.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/wireguard-install.sh b/wireguard-install.sh index cec2b4b..f0487fe 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -132,6 +132,16 @@ PublicKey = $SERVER_PUB_KEY Endpoint = $ENDPOINT AllowedIPs = 0.0.0.0/0,::/0" >> "$HOME/$SERVER_WG_NIC-client.conf" +# Ask for pre-shared symmetric key +read -r -p "Want to use pre-shared symmetric key? [y/N] " response +case "$response" in + [yY][eE][sS]|[yY]) + CLIENT_SYMM_PRE_KEY=$( wg genpsk ) + echo "PresharedKey = $CLIENT_PRE_KEY" >> "/etc/wireguard/$SERVER_WG_NIC.conf" + echo "PresharedKey =$CLIENT_PRE_KEY" >> "$HOME/$SERVER_WG_NIC-client.conf" + ;; +esac + chmod 600 -R /etc/wireguard/ # Enable routing on the server |