Last active
May 28, 2019 22:08
-
-
Save dober/3015ef808371d6ee33ec712731696ba7 to your computer and use it in GitHub Desktop.
[mikrotik] ddns update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### set email by cli | |
/tool e-mail | |
set address=74.125.131.108 ### smtp.gmail.com | |
set port=587 | |
set [email protected] | |
set user=gmail_user | |
set password=gmail_password | |
### test email | |
send [email protected] subject="email test" body="email test" start-tls=yes | |
### script | |
:global ddnshostname "@" | |
:global ddnsdomain "domain.tld" | |
:global ddnspass "your_password" | |
:log info ("DDNS: Updating") | |
:local str "https://dynamicdns.park-your-domain.com/update\3Fhost=$ddnshostname&domain=$ddnsdomain&password=$ddnspass" | |
:local IP [:resolve "your_domain"]; | |
/tool fetch url=($str) mode=https keep-result=no | |
/tool e-mail send to="[email protected]" subject="your_domain" body="Your IP: $IP" start-tls=yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment