Compare commits

..

47 commits

Author SHA1 Message Date
Christian Hesse
b167a2daed DEBUG: fix typo 2025-05-13 10:21:42 +02:00
Christian Hesse
cae5fdc341 telegram-chat: support debug output for Updates in JSON 2025-05-13 10:21:42 +02:00
Christian Hesse
f4f83533b9 telegram-chat: support trusted group chat ids
But be warned: Adding a person to a trusted group will give
her/him administrative control over the device(s) - without
changes on the device itself!
2025-05-13 10:21:38 +02:00
Christian Hesse
1cbd06b77d mod/notification-telegram: fix indention 2025-05-13 09:22:45 +02:00
Christian Hesse
616cb4cdf8 fw-addr-lists: for IPv6 the CIDR is always expected 2025-05-13 09:22:45 +02:00
Christian Hesse
a341850d1b mod/notification-email: add the link symbol 2025-05-13 09:22:45 +02:00
Christian Hesse
cee5edc891 mod/notification-email: properly truncate the body
Truned out that the size limit for e-mail message/body is anywhere just
below 64kB... So truncate  at about 62.000 bytes.
2025-05-13 09:22:45 +02:00
Christian Hesse
0d408b159f mod/notification-email: add error handling when sending mail 2025-05-13 09:22:45 +02:00
Christian Hesse
a5c8bee7d4 mod/inspectvar: replace only when matching 2025-05-13 09:22:45 +02:00
Christian Hesse
0f6e862a2c mod/inspectvar: remove CR, replace LF 2025-05-13 09:22:45 +02:00
Christian Hesse
7566301e4c mod/inspectvar: print the length for strings 2025-05-13 09:22:45 +02:00
Christian Hesse
70338833fb mod/inspectvar: use $CharacterMultiply 2025-05-13 09:22:45 +02:00
Christian Hesse
4a1a3dc2ed Merge branch 'onerror' into next 2025-05-13 09:22:45 +02:00
Christian Hesse
98b1b4e050 update-tunnelbroker: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
c9e7d89413 unattended-lte-firmware-upgrade: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
fca3f21ab2 telegram-chat: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
38736970b4 sms-forward: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
c664df4f90 netwatch-notify: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
a50b11e2c3 netwatch-dns: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
13ec2707a7 mod/ssh-keys-import: fix error condition 2025-05-13 09:22:45 +02:00
Christian Hesse
877429c721 mod/ssh-keys-import: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
2c61beae6a mod/scriptrunonce: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
e60980ae33 mode-button: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
7859dabdb2 mod/notification-gotify: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
a084cbdf75 mod/notification-matrix: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
b8db168e0c mod/notification-ntfy: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
a7182fdd71 mod/notification-telegram: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
b115fc64a0 lease-script: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
f633b82078 gps-track: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
88cfa395b5 global-functions: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
35c20b85f5 global-functions: $ValidateSyntax: add debug output 2025-05-13 09:22:45 +02:00
Christian Hesse
66a6dbb5b6 global-functions: $ValidateSyntax: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
c1f316212a global-functions: $ScriptInstallUpdate: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
2a5d1f7bb8 global-functions: $RmFile: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
2ca1afa14f global-functions: $RmDir: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
883eca0a90 global-functions: $MkDir: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
d8f0a8902d global-functions: $GetMacVendor: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
5f82a9fa21 global-functions: $FetchHuge: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
26bae641ef global-functions: $DownloadPackage: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
63b1acbe9b global-config: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
be93cd7d27 fw-addr-lists: adopt changes in wording 2025-05-13 09:22:45 +02:00
Christian Hesse
83949e9671 fw-addr-lists: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
debf9abf4f check-routeros-update: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
750b784b34 check-lte-firmware-upgrade: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
3a130ed870 check-health: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
b0096ee531 backup-upload: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
Christian Hesse
d9ac16d207 backup-partition: :do ... on-error=... -> :onerror ... do=... 2025-05-13 09:22:45 +02:00
2 changed files with 15 additions and 12 deletions

View file

@ -35,12 +35,12 @@
:onerror Err {
/partitions/copy-to $FallbackTo;
$LogPrint info $ScriptName ("Copied RouterOS to partition '" . $FallbackToName . "'.");
:return true;
} do={
$LogPrint error $ScriptName ("Failed copying RouterOS to partition '" . \
$FallbackToName . "': " . $Err);
:return false;
}
:return true;
}
:if ([ $ScriptLock $ScriptName ] = false) do={

View file

@ -391,22 +391,25 @@
:local Url ("https://upgrade.mikrotik.com/routeros/" . $PkgVer . "/" . $PkgFile);
$LogPrint info $0 ("Downloading package file '" . $PkgName . "'...");
$LogPrint debug $0 ("... from url: " . $Url);
:local Retry 3;
:while ($Retry > 0) do={
:onerror Err {
/tool/fetch check-certificate=yes-without-crl $Url dst-path=$PkgDest;
$WaitForFile $PkgDest;
:onerror Err {
/tool/fetch check-certificate=yes-without-crl $Url dst-path=$PkgDest;
$WaitForFile $PkgDest;
} do={
$LogPrint warning $0 ("Downloading package file '" . $PkgName . "' failed: " . $Err);
:return false;
}
:if ([ /file/get [ find where name=$PkgDest ] type ] = "package") do={
:return true;
}
} do={
$LogPrint debug $0 ("Downloading package file failed: " . $Err);
}
:if ([ /file/get [ find where name=$PkgDest ] type ] != "package") do={
$LogPrint warning $0 ("Downloaded file is not a package, removing.");
$RmFile $PkgDest;
:return false;
:set Retry ($Retry - 1);
}
:return true;
$LogPrint warning $0 ("Downloading package file '" . $PkgName . "' failed.");
:return false;
}
# return either first (if "true") or second