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