Skip to content

Commit

Permalink
Fix for Linux clients
Browse files Browse the repository at this point in the history
- Limit client names to 15 characters for compatibility with
  Linux WireGuard clients.
  Ref: Upstream commit Nyr/wireguard-install 7865df2.
  • Loading branch information
hwdsl2 committed Oct 20, 2023
1 parent 6644997 commit fab2a6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wireguard-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit fab2a6d

Please sign in to comment.