Page 1 of 1

Script to check for new developer versions

Posted: Sun Oct 01, 2023 8:50 pm
by diamuxin
Hi, I have created this script to inform me about new testing versions, but sometimes I get an error:

failure: closing connection: <404 Not Found> 159.148.172.226:80 (4)

And sometimes it works fine.

Do you see any error in the code? thanks.
:global prev ""
:local ch [/system package update get channel]
:if ($ch~"stable") do={/system package update set channel=testing}
:local latest [/system package update get latest-version]
:local changeLog ([/tool fetch "http://upgrade.mikrotik.com/routeros/$latest/CHANGELOG" output=user as-value] -> "data")
    
:if ($latest != $prev) do={
    /tool e-mail send to="admin@mail.com" subject="[Router $sysname] New Testing Version" body="Latest testing version: $latest \n\n $changeLog"
    :set prev $latest
    :delay 1s
    /system package update set channel=stable
} else={
    :log info "Testing Info: No new development version. Current: $latest"
}

Re: Script to check for new developer versions  [SOLVED]

Posted: Mon Oct 02, 2023 10:35 am
by nediis
try requesting 2 times with a delay
:local latest [/system package update get latest-version]
:delay 1
:set latest [/system package update get latest-version]
sometimes it returns empty value or check for empty value

Re: Script to check for new developer versions

Posted: Tue Oct 03, 2023 12:59 am
by diamuxin
try requesting 2 times with a delay
:local latest [/system package update get latest-version]
:delay 1
:set latest [/system package update get latest-version]
sometimes it returns empty value or check for empty value
Ok thanks, this way it seems that it has not given error again.