Skip to content

Instantly share code, notes, and snippets.

View BrianMoos's full-sized avatar

Brian Moos Lindberg BrianMoos

View GitHub Profile
#!/bin/bash
#Source https://michaelryom.dk/custom-ddns-on-ubiquiti-usg/
cat << 'EOF' > /etc/cron.hourly/ddns
#!/bin/bash
IP=$(curl -s -L "http://ipv4.myip.dk/api/info/IPv4Address" | sed -e 's/^"//' -e 's/"$//')
curl -s -L "https://api.unoeuro.com/ddns.php?apikey=<API key>&domain=<Domain>&hostname=<Sub domain>&myip=$IP" | logger
EOF
chmod +x /etc/cron.hourly/ddns