mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
gps-track: use custom user agent string
This commit is contained in:
@ -17,6 +17,7 @@
|
|||||||
:global GpsTrackUrl;
|
:global GpsTrackUrl;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
:global FetchUserAgentStr;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
@ -31,10 +32,10 @@
|
|||||||
|
|
||||||
:if ($Gps->"valid" = true) do={
|
:if ($Gps->"valid" = true) do={
|
||||||
:do {
|
:do {
|
||||||
/tool/fetch check-certificate=yes-without-crl $GpsTrackUrl output=none \
|
/tool/fetch check-certificate=yes-without-crl output=none http-method=post \
|
||||||
http-method=post http-header-field=({ "Content-Type: application/json" }) \
|
http-header-field=({ [ $FetchUserAgentStr $ScriptName ]; "Content-Type: application/json" }) \
|
||||||
http-data=[ :serialize to=json { "identity"=$Identity; \
|
http-data=[ :serialize to=json { "identity"=$Identity; \
|
||||||
"lat"=($Gps->"latitude"); "lon"=($Gps->"longitude") } ] as-value;
|
"lat"=($Gps->"latitude"); "lon"=($Gps->"longitude") } ] $GpsTrackUrl as-value;
|
||||||
$LogPrint debug $ScriptName ("Sending GPS data in " . $CoordinateFormat . " format: " . \
|
$LogPrint debug $ScriptName ("Sending GPS data in " . $CoordinateFormat . " format: " . \
|
||||||
"lat: " . ($Gps->"latitude") . " " . \
|
"lat: " . ($Gps->"latitude") . " " . \
|
||||||
"lon: " . ($Gps->"longitude"));
|
"lon: " . ($Gps->"longitude"));
|
||||||
|
Reference in New Issue
Block a user