mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-20 17:55:40 +02:00
gps-track: :do ... on-error=... -> :onerror ... do=...
This commit is contained in:
parent
5c599beae1
commit
d5f9ecebfb
1 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@
|
|||
:local Gps [ /system/gps/monitor once as-value ];
|
||||
|
||||
:if ($Gps->"valid" = true) do={
|
||||
:do {
|
||||
:onerror Err {
|
||||
/tool/fetch check-certificate=yes-without-crl output=none http-method=post \
|
||||
http-header-field=({ [ $FetchUserAgentStr $ScriptName ]; "Content-Type: application/json" }) \
|
||||
http-data=[ :serialize to=json { "identity"=$Identity; \
|
||||
|
@ -42,8 +42,8 @@
|
|||
$LogPrint debug $ScriptName ("Sending GPS data in " . $CoordinateFormat . " format: " . \
|
||||
"lat: " . ($Gps->"latitude") . " " . \
|
||||
"lon: " . ($Gps->"longitude"));
|
||||
} on-error={
|
||||
$LogPrint warning $ScriptName ("Failed sending GPS data!");
|
||||
} do={
|
||||
$LogPrint warning $ScriptName ("Failed sending GPS data: " . $Err);
|
||||
}
|
||||
} else={
|
||||
$LogPrint debug $ScriptName ("GPS data not valid.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue