mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-27 03:48:57 +02:00
gps-track: add error handling
This commit is contained in:
parent
679c971ea6
commit
1e29eeb388
1 changed files with 14 additions and 10 deletions
|
@ -24,6 +24,7 @@ $WaitFullyConnected;
|
||||||
:local Gps [ /system/gps/monitor once as-value ];
|
:local Gps [ /system/gps/monitor once as-value ];
|
||||||
|
|
||||||
:if ($Gps->"valid" = true) do={
|
:if ($Gps->"valid" = true) do={
|
||||||
|
:do {
|
||||||
/tool/fetch check-certificate=yes-without-crl $GpsTrackUrl output=none \
|
/tool/fetch check-certificate=yes-without-crl $GpsTrackUrl output=none \
|
||||||
http-method=post http-header-field="Content-Type: application/json" \
|
http-method=post http-header-field="Content-Type: application/json" \
|
||||||
http-data=("{" . \
|
http-data=("{" . \
|
||||||
|
@ -34,6 +35,9 @@ $WaitFullyConnected;
|
||||||
$LogPrintExit2 debug $0 ("Sending GPS data in " . $CoordinateFormat . " format: " . \
|
$LogPrintExit2 debug $0 ("Sending GPS data in " . $CoordinateFormat . " format: " . \
|
||||||
"lat: " . ($Gps->"latitude") . " " . \
|
"lat: " . ($Gps->"latitude") . " " . \
|
||||||
"lon: " . ($Gps->"longitude")) false;
|
"lon: " . ($Gps->"longitude")) false;
|
||||||
|
} on-error={
|
||||||
|
$LogPrintExit2 warning $0 ("Failed sending GPS data!") false;
|
||||||
|
}
|
||||||
} else={
|
} else={
|
||||||
$LogPrintExit2 debug $0 ("GPS data not valid.") false;
|
$LogPrintExit2 debug $0 ("GPS data not valid.") false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue