From fab2a6d41e15eab1400b84cf78c884cf39bacca6 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Fri, 20 Oct 2023 00:29:37 -0500 Subject: [PATCH] Fix for Linux clients - Limit client names to 15 characters for compatibility with Linux WireGuard clients. Ref: Upstream commit Nyr/wireguard-install 7865df2. --- wireguard-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index f00f298..b775dc4 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -288,7 +288,8 @@ enter_custom_dns() { set_client_name() { # Allow a limited set of characters to avoid conflicts - client=$(sed 's/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-]/_/g' <<< "$unsanitized_client") + # Limit to 15 characters for compatibility with Linux clients + client=$(sed 's/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-]/_/g' <<< "$unsanitized_client" | cut -c-15) } enter_client_name() {