mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 09:59:28 +00:00
global-functions: $FetchUserAgentStr: add commit info in user agent string
This commit is contained in:
parent
3ad33681a1
commit
f5fe673605
1 changed files with 8 additions and 2 deletions
|
|
@ -539,10 +539,16 @@
|
||||||
:set FetchUserAgentStr do={
|
:set FetchUserAgentStr do={
|
||||||
:local Caller [ :tostr $1 ];
|
:local Caller [ :tostr $1 ];
|
||||||
|
|
||||||
|
:global CommitId;
|
||||||
|
:global CommitInfo;
|
||||||
|
|
||||||
|
:global IfThenElse;
|
||||||
|
|
||||||
:local Resource [ /system/resource/get ];
|
:local Resource [ /system/resource/get ];
|
||||||
|
|
||||||
:return ("User-Agent: Mikrotik/" . $Resource->"version" . " " . \
|
:return ("User-Agent: Mikrotik/" . $Resource->"version" . " " . $Resource->"architecture-name" . \
|
||||||
$Resource->"architecture-name" . " " . $Caller . "/Fetch (https://rsc.eworm.de/)");
|
" " . $Caller . "/Fetch (https://rsc.eworm.de/" . [ $IfThenElse ($CommitId != "unknown") \
|
||||||
|
("; " . $CommitInfo . "/" . [ :pick $CommitId 0 8 ]) ] . ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
# check for existence of file, optionally with type
|
# check for existence of file, optionally with type
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue