Merge pull request #310 from PMExtra/aaaa-support

支持IPv6节点DNS解析
This commit is contained in:
老竭力 2022-11-18 00:12:11 +08:00 committed by GitHub
commit ec1b49f643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,6 +192,8 @@ start_rules() {
server=$(ping ${server} -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
if echo $server | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
echo $server >/etc/ssr_ip
elif [ "$server" != "${server#*:[0-9a-fA-F]}" ]; then
echo $server >/etc/ssr_ip
else
server=$(cat /etc/ssr_ip)
fi
@ -221,6 +223,8 @@ start_rules() {
udp_server=$(ping ${udp_server} -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
if echo $udp_server | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
echo $udp_server >/etc/ssr_ip
elif [ "$udp_server" != "${udp_server#*:[0-9a-fA-F]}" ]; then
echo $udp_server >/etc/ssr_ip
else
udp_server=$(cat /etc/ssr_ip)
fi