Skip to content

Instantly share code, notes, and snippets.

@refabr1k
Created August 30, 2020 06:30
Show Gist options
  • Save refabr1k/d52f38692cb12701fb415a7f983ea54b to your computer and use it in GitHub Desktop.
Save refabr1k/d52f38692cb12701fb415a7f983ea54b to your computer and use it in GitHub Desktop.
Mikrotik get public IP and send to telegram bot
{
/tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path=mypublicip.txt
local ip [file get mypublicip.txt contents ]
put $ip
/tool fetch "https://api.telegram.org/<BOTAPI>/sendmessage\?chat_id=<CHATID>&text=Wan IP: $ip" keep-result=no;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment