Update serv00.sh

This commit is contained in:
甬哥侃侃侃ygkkk
2025-02-14 12:23:27 +08:00
committed by GitHub
parent a7d19e761f
commit fa2e4f37e0
+2 -2
View File
@@ -1310,13 +1310,13 @@ nb=$(echo "$HOSTNAME" | cut -d '.' -f 1 | tr -d 's')
ym=("$HOSTNAME" "cache$nb.serv00.com" "web$nb.serv00.com")
rm -rf $WORKDIR/ip.txt $WORKDIR/hy2ip.txt
for ip in "${ym[@]}"; do
dig @8.8.8.8 +time=2 +short $ip >> $WORKDIR/hy2ip.txt
dig @8.8.8.8 +time=5 +short $ip >> $WORKDIR/hy2ip.txt
sleep 1
done
for host in "${ym[@]}"; do
response=$(curl -sL --connect-timeout 5 --max-time 7 "https://ss.serv0.us.kg/api/getip?host=$host")
if [[ "$response" =~ ^$|unknown|not|error ]]; then
dig @8.8.8.8 +time=2 +short $host >> $WORKDIR/ip.txt
dig @8.8.8.8 +time=5 +short $host >> $WORKDIR/ip.txt
sleep 1
else
echo "$response" | while IFS='|' read -r ip status; do