mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-27 14:24:50 +02:00
global-functions: introduce $AlignRight
This commit is contained in:
parent
cae5f425a6
commit
1cc0e3429b
1 changed files with 14 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
||||||
:global Identity [ /system/identity/get name ];
|
:global Identity [ /system/identity/get name ];
|
||||||
|
|
||||||
# global functions
|
# global functions
|
||||||
|
:global AlignRight;
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
:global CertificateDownload;
|
:global CertificateDownload;
|
||||||
:global CertificateNameByCN;
|
:global CertificateNameByCN;
|
||||||
|
@ -72,6 +73,19 @@
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
:global WaitTimeSync;
|
: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
|
# check and download required certificate
|
||||||
:set CertificateAvailable do={
|
:set CertificateAvailable do={
|
||||||
:local CommonName [ :tostr $1 ];
|
:local CommonName [ :tostr $1 ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue