mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: introduce $AlignRight
This commit is contained in:
parent
cae5f425a6
commit
1cc0e3429b
|
@ -20,6 +20,7 @@
|
|||
:global Identity [ /system/identity/get name ];
|
||||
|
||||
# global functions
|
||||
:global AlignRight;
|
||||
:global CertificateAvailable;
|
||||
:global CertificateDownload;
|
||||
:global CertificateNameByCN;
|
||||
|
@ -72,6 +73,19 @@
|
|||
:global WaitFullyConnected;
|
||||
:global WaitTimeSync;
|
||||
|
||||
# align string to the right
|
||||
:global AlignRight do={
|
||||
:local Input [ :tostr $1 ];
|
||||
:local Len [ :tonum $2 ];
|
||||
|
||||
:global EitherOr;
|
||||
|
||||
:local Spaces " ";
|
||||
:set Len [ $EitherOr $Len 8 ];
|
||||
|
||||
:return ([ :pick $Spaces 0 ($Len - [ :len $Input ]) ] . $Input);
|
||||
}
|
||||
|
||||
# check and download required certificate
|
||||
:set CertificateAvailable do={
|
||||
:local CommonName [ :tostr $1 ];
|
||||
|
|
Loading…
Reference in a new issue