Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
@adrianmihalko

This comment has been minimized.

Copy link

adrianmihalko commented Dec 3, 2018

On my USG I have two WAN. Do you have an idea how it would be possible to get WAN2 public ip?

@adrianmihalko

This comment has been minimized.

Copy link

adrianmihalko commented Dec 3, 2018

IP=$(ip address show pppoe0 | grep 'inet ' | awk '{print $2}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.