mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-28 14:54:51 +02:00
mod/notification-ntfy: use :onerror for outer block
This commit is contained in:
parent
d865deb8a8
commit
e3a15cc6b8
1 changed files with 6 additions and 6 deletions
|
@ -16,7 +16,7 @@
|
||||||
:global SendNtfy2;
|
:global SendNtfy2;
|
||||||
|
|
||||||
# flush ntfy queue
|
# flush ntfy queue
|
||||||
:set FlushNtfyQueue do={ :do {
|
:set FlushNtfyQueue do={ :onerror Err {
|
||||||
:global NtfyQueue;
|
:global NtfyQueue;
|
||||||
|
|
||||||
:global IsFullyConnected;
|
:global IsFullyConnected;
|
||||||
|
@ -52,8 +52,8 @@
|
||||||
/system/scheduler/remove [ find where name="_FlushNtfyQueue" ];
|
/system/scheduler/remove [ find where name="_FlushNtfyQueue" ];
|
||||||
:set NtfyQueue;
|
:set NtfyQueue;
|
||||||
}
|
}
|
||||||
} on-error={
|
} do={
|
||||||
:global ExitError; $ExitError false $0;
|
:global ExitError; $ExitError false $0 $Err;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
# send notification via ntfy - expects one array argument
|
# send notification via ntfy - expects one array argument
|
||||||
|
@ -143,12 +143,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
# send notification via ntfy - expects at least two string arguments
|
# send notification via ntfy - expects at least two string arguments
|
||||||
:set SendNtfy do={ :do {
|
:set SendNtfy do={ :onerror Err {
|
||||||
:global SendNtfy2;
|
:global SendNtfy2;
|
||||||
|
|
||||||
$SendNtfy2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 });
|
$SendNtfy2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 });
|
||||||
} on-error={
|
} do={
|
||||||
:global ExitError; $ExitError false $0;
|
:global ExitError; $ExitError false $0 $Err;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
# send notification via ntfy - expects one array argument
|
# send notification via ntfy - expects one array argument
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue