support AAAA record

This commit is contained in:
PMExtra 2022-11-18 00:05:43 +08:00
parent ce0e0ff403
commit c1e5ee04ea

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