Community discussions

MikroTik App
 
qbek
just joined
Topic Author
Posts: 20
Joined: Mon Sep 21, 2015 3:34 pm
Location: Poland
Contact:

freedns.afraid.org script

Sun Apr 25, 2021 10:20 am

Hi.
I'm looking for freedns.afraid.org script. This script don't work viewtopic.php?f=13&t=83744&p=682899&hil ... ns#p682899
RB951Ui-2HnD firmware v6.48.2
 
zolstarym
just joined
Posts: 2
Joined: Mon May 03, 2021 4:43 am

Re: freedns.afraid.org script

Wed May 05, 2021 12:13 am

I second this. I have tried a different script that also doesn't work on the 4011. I think most of them are out of date.
 
sid5632
Long time Member
Long time Member
Posts: 552
Joined: Fri Feb 17, 2017 6:05 pm

Re: freedns.afraid.org script

Wed May 05, 2021 11:26 am

I just run this:
:delay 10
:resolve freedns.afraid.org
:delay 20
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\?key-goes-here" keep-result=no
in the PPP profile script, substituting "key-goes-here" for the real update key.
 
Caed
just joined
Posts: 5
Joined: Fri Aug 30, 2013 8:28 am

Re: freedns.afraid.org script

Fri Oct 22, 2021 4:10 am

I'm using routeros v6.49
 /tool fetch mode=https url="https://freedns.afraid.org/dynamic/update.php___KEY___" keep-result=no

  status: failed

failure: closing connection: <404 Not Found> 69.42.215.252:443 (4)
My key above has been replaced with ___KEY___ for posting.
This used to work for me, but I haven't checked it recently and now it fails. I retrieved the URL again from my acct. on Afraid to confirm nothing changed and it still fails.
 
Caed
just joined
Posts: 5
Joined: Fri Aug 30, 2013 8:28 am

Re: freedns.afraid.org script

Fri Oct 22, 2021 4:19 am

This worked on v6.49:
/tool fetch mode=https url="https://freedns.afraid.org" http-data="dynamic/update.php__MYKEY__" keep-result=no
.
.
/tool fetch mode=https url="https://freedns.afraid.org" http-data="dynamic/update.php__MYKEY__" keep-result=no
      status: finished
  downloaded: 12KiB-z pause]
       total: 0KiB
    duration: 0s
 
Caed
just joined
Posts: 5
Joined: Fri Aug 30, 2013 8:28 am

Re: freedns.afraid.org script

Fri Oct 22, 2021 4:33 am

Better yet, here's the whole script down below.
  • You'll need to update the variables at the top with YOUR info.
  • WANInter is what you've named your interface that connects to your ISP.
  • AfraidDomain is what YOU use for your subdomain name on Afraid.org.
  • Remove the underscores surrounding __YOUR_KEY__ and just paste your key after "php", no spaces.
.
.
:global AfraidUser "YOUR_Afraid_Username"
:global AfraidPass "YOUR_Afraid_Password"
:global WANInter "WAN"
:global AfraidDomain "YOUR_Afraid.domain.com"

:global IPCurrent [/ip address get [find interface=$WANInter] address];
:log info $IPCurrent
# FOR loop strips CIDR from end of IP address
:for i from=( [:len $IPCurrent] - 1) to=0 do={
  :if ( [:pick $IPCurrent $i] = "/") do={ 
    :global NewIP [:pick $IPCurrent 0 $i];
    :global NoCIDR [:pick $IPCurrent 0 $i];
    :log info $NoCIDR

    :if ([:resolve $AfraidDomain] != $NewIP) do={
      :log info [/tool fetch mode=https url="https://freedns.afraid.org/dynamic" http-data="/update.php__YOUR_KEY__" keep-result=no]
      :log info "Afraid.org New IP Found: $AfraidDomain - $NewIP"
     } else={
     :log info "Afraid.org: CURRENT IP: $NoCIDR  NEW IP:  $NewIP";
    }
   } 
}
 
cwebb
just joined
Posts: 1
Joined: Fri Apr 17, 2020 8:53 pm

Re: freedns.afraid.org script

Wed Dec 29, 2021 2:41 pm

Thanks caed, that worked like a charm! Also had to change the permissions from my many years old script.

Can you maybe elaborate what permissions are needed (and which ones could be turned off)?

Who is online

Users browsing this forum: Google [Bot], lurker888 and 43 guests