chore: format

This commit is contained in:
huzibaca 2024-11-19 13:28:17 +08:00
parent f50b9655ae
commit 3ae1109a31
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302

View File

@ -21,7 +21,7 @@ function is_valid_ipv4() {
# 验证IPv6地址格式 # 验证IPv6地址格式
function is_valid_ipv6() { function is_valid_ipv6() {
local ip=$1 local ip=$1
if [[ ! $ip =~ ^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$ ]] && \ if [[ ! $ip =~ ^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$ ]] &&
[[ ! $ip =~ ^(([0-9a-fA-F]{0,4}:){0,7}:|(:[0-9a-fA-F]{0,4}:){0,6}:[0-9a-fA-F]{0,4})$ ]]; then [[ ! $ip =~ ^(([0-9a-fA-F]{0,4}:){0,7}:|(:[0-9a-fA-F]{0,4}:){0,6}:[0-9a-fA-F]{0,4})$ ]]; then
return 1 return 1
fi fi