From 7aab6ffd2aa8d04b25d1b2bf235716e68eba4726 Mon Sep 17 00:00:00 2001 From: Nikos Vourdas <32869078+nickvourd@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:07:34 -0700 Subject: [PATCH] Update wireguard-install.sh --- wireguard-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 6f207c0..7e213ea 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -362,16 +362,16 @@ DNS = ${CLIENT_DNS_1},${CLIENT_DNS_2} PublicKey = ${SERVER_PUB_KEY} PresharedKey = ${CLIENT_PRE_SHARED_KEY} Endpoint = ${ENDPOINT} -AllowedIPs = ${ALLOWED_IPS}" >"${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf -PersistentKeepalive = 10" +AllowedIPs = ${ALLOWED_IPS} +PersistentKeepalive = 10" > "${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf" # Add the client as a peer to the server echo -e "\n### Client ${CLIENT_NAME} [Peer] PublicKey = ${CLIENT_PUB_KEY} PresharedKey = ${CLIENT_PRE_SHARED_KEY} -AllowedIPs = ${CLIENT_WG_IPV4}/32,${CLIENT_WG_IPV6}/128" >>"/etc/wireguard/${SERVER_WG_NIC}.conf -PersistentKeepalive = 10" +AllowedIPs = ${CLIENT_WG_IPV4}/32,${CLIENT_WG_IPV6}/128 +PersistentKeepalive = 10" >> "/etc/wireguard/${SERVER_WG_NIC}.conf" wg syncconf "${SERVER_WG_NIC}" <(wg-quick strip "${SERVER_WG_NIC}")