I also use a script to automatically update my router (and multiple APs using Capsman), and it recently stopped working, returning a "403" error code.
This is the script I use:
{
:local pkgs ("routeros");
:local archs {"arm64"; "arm"};
# Example: https://cdn.mikrotik.com/routeros/7.14.2/routeros-7.14.2-arm.npk
:local mode "https"
:local downloaddomain "cdn.mikrotik.com"
:log info "Refreshing CAP packages files..."
# do NOT include the leading slash, or file check will always fail
:local upgradedir "firmware"
/system/package/update check-for-updates once
:delay 3s;
:local curVer [/system/package/update/get installed-version]
:local newVer [/system/package/update/get latest-version]
:foreach pkg in=$pkgs do={
:foreach arch in=$archs do={
:local oldPkgName "$pkg-$curVer-$arch.npk"
:local newPkgName "$pkg-$newVer-$arch.npk"
:log debug "Current package name: $oldPkgName"
:log debug "New package name: $newPkgName"
:local exists [:len [/file/find name="$upgradedir/$newPkgName"]]
:if ($exists = 0) do={
:local path [ :put "/routeros/$newVer/$newPkgName" ]
:log info " => Downloading package v$newVer for $arch from $mode://$downloaddomain$path"
/tool fetch http-method=get address="$downloaddomain" mode=$mode src-path="$path" dst-path="$upgradedir/$newPkgName"
:if ($oldPkgName != $newPkgName) do {
/file/remove "$upgradedir/$pkg-$curVer-$arch.npk"
}
}
}
}
}
it has worked perfectly until recently with no change, but now it does this:
Screenshot_20240327_153210.png
Is there something to do about this?
For completion, here's a wget output:
wget https://cdn.mikrotik.com/routeros/7.14.2/routeros-7.14.2-arm64.npk
--2024-03-27 15:36:37-- https://cdn.mikrotik.com/routeros/7.14.2/routeros-7.14.2-arm64.npk
Resolving cdn.mikrotik.com (cdn.mikrotik.com)... 159.148.147.244
Connecting to cdn.mikrotik.com (cdn.mikrotik.com)|159.148.147.244|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12212134 (12M) [application/octet-stream]
Saving to: ‘routeros-7.14.2-arm64.npk’
routeros-7.14.2-arm64.npk 100%[==============================================>] 11.65M 8.36MB/s in 1.4s
2024-03-27 15:36:40 (8.36 MB/s) - ‘routeros-7.14.2-arm64.npk’ saved [12212134/12212134]
and a static /tool/fetch call:
[xenhat@router] > /tool fetch http-method=get address=cdn.mikrotik.com mode=https src-path=/routeros/7.14.2/routeros-7.14.2-arm64.npk
status: failed
failure: Fetch failed with status 403
You do not have the required permissions to view the files attached to this post.