Skip to content

Instantly share code, notes, and snippets.

@adrianmihalko
Created January 11, 2019 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianmihalko/ff01b7b3c0321d0fcb1cfa9935ea6ff2 to your computer and use it in GitHub Desktop.
Save adrianmihalko/ff01b7b3c0321d0fcb1cfa9935ea6ff2 to your computer and use it in GitHub Desktop.
Custom DDNS on Ubiquiti USG for specific interface
/etc/cron.hourly/ddns:
#!/bin/bash
YDNS_USER=
YDNS_PASSWD=
HOST=.ydns.eu
INTERFACE=pppoe0
IP=$(ip address show ${INTERFACE} | grep 'inet ' | awk '{print $2}')
curl --basic -u "$YDNS_USER:$YDNS_PASSWD" --silent "https://ydns.io/api/v1/update/?host=${HOST}&ip=${IP}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment