From e983894e93e00e76e7be532ab3dd3ab47abbe5ff Mon Sep 17 00:00:00 2001 From: Teddysun Date: Fri, 14 Feb 2020 17:29:02 +0900 Subject: [PATCH] Update wireguard.sh --- wireguard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wireguard.sh b/wireguard.sh index 873bdfc..63c6bca 100644 --- a/wireguard.sh +++ b/wireguard.sh @@ -521,7 +521,7 @@ add_client() { client_ipv6=(${client_ipv6[@]} ${tmp_ipv6}) done # Sort array - client_ipv4_sorted=($(printf '%s\n' "${client_ipv4[@]}" | sort)) + client_ipv4_sorted=($(printf '%s\n' "${client_ipv4[@]}" | sort -V)) index=$(expr ${#client_ipv4[@]} - 1) last_ip=$(echo ${client_ipv4_sorted[$index]} | cut -d. -f4) issue_ip_last=$(expr ${last_ip} + 1)