mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-21 19:34:41 +02:00
gps-track: use custom user agent string
This commit is contained in:
parent
d31afc9ec3
commit
5736ecebc5
1 changed files with 4 additions and 3 deletions
|
@ -17,6 +17,7 @@
|
|||
:global GpsTrackUrl;
|
||||
:global Identity;
|
||||
|
||||
:global FetchUserAgentStr;
|
||||
:global LogPrint;
|
||||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
@ -31,10 +32,10 @@
|
|||
|
||||
:if ($Gps->"valid" = true) do={
|
||||
:do {
|
||||
/tool/fetch check-certificate=yes-without-crl $GpsTrackUrl output=none \
|
||||
http-method=post http-header-field=({ "Content-Type: application/json" }) \
|
||||
/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; \
|
||||
"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: " . \
|
||||
"lat: " . ($Gps->"latitude") . " " . \
|
||||
"lon: " . ($Gps->"longitude"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue