mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-14 15:08:39 +02:00
global-functions: introduce $ProtocolStrip
This commit is contained in:
parent
b50a5b294a
commit
6fd0becf64
1 changed files with 12 additions and 0 deletions
|
@ -58,6 +58,7 @@
|
||||||
:global ParseDate;
|
:global ParseDate;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
:global PrettyPrint;
|
:global PrettyPrint;
|
||||||
|
:global ProtocolStrip;
|
||||||
:global RandomDelay;
|
:global RandomDelay;
|
||||||
:global RequiredRouterOS;
|
:global RequiredRouterOS;
|
||||||
:global ScriptFromTerminal;
|
:global ScriptFromTerminal;
|
||||||
|
@ -885,6 +886,17 @@
|
||||||
:put [ $Unix2Dos $Input ];
|
:put [ $Unix2Dos $Input ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# strip protocol from from url string
|
||||||
|
:set ProtocolStrip do={
|
||||||
|
:local Input [ :tostr $1 ];
|
||||||
|
|
||||||
|
:local Pos [ :find $Input "://" ];
|
||||||
|
:if ([ :typeof $Pos ] = "nil") do={
|
||||||
|
:return $Input;
|
||||||
|
}
|
||||||
|
:return [ :pick $Input ($Pos + 3) [ :len $Input ] ];
|
||||||
|
}
|
||||||
|
|
||||||
# delay a random amount of seconds
|
# delay a random amount of seconds
|
||||||
:set RandomDelay do={
|
:set RandomDelay do={
|
||||||
:local Time [ :tonum $1 ];
|
:local Time [ :tonum $1 ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue