Files
Server-scripts/docker_compose/mediahost/nginx/selfhost-ddns.sh
T

19 lines
419 B
Bash
Raw Normal View History

2026-10-01 14:02:46 +00:00
#!/bin/bash
# selfHOST DynDNS Update Script
URL='https://549335:GoviYPrfj4XI@carol.selfhost.de/nic/update?myip='
# Get current public IPv4 address
PUBLIC_IP=$(curl -4 -s https://api.ipify.org)
# Exit if IP detection failed
if [ -z "$PUBLIC_IP" ]; then
echo "$(date): Failed to determine public IP"
exit 1
fi
# Send update to selfHOST
RESULT=$(curl -s "${URL}${PUBLIC_IP}")
echo "$(date): IP=${PUBLIC_IP}"