scripts/check-ip.sh
2026-01-03 15:47:32 +03:00

20 lines
432 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
read -p "URL для проверки: " url
read -p "IP для проверки: " ipaddr
while true; do
timestamp=$(date +"%H:%M:%S")
result=$(nslookup $url | grep $ipaddr)
if [ -n "$result" ]; then
echo "✔️ Запись обновилась."
echo "$result"
exit 0
fi
printf "\r🔃Проверил $ipaddr в $timestamp: Запись еще не обновилась."
sleep 60
done