aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions.rsc14
1 files changed, 14 insertions, 0 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 090269d..c356606 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -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 ];