aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-12-13 10:37:56 +0100
committerGravatar Christian Hesse <mail@eworm.de>2022-12-13 10:37:56 +0100
commit58f769ac0016025533248aba5cd63436b00fc3db (patch)
tree624aff5b7c9ec6da3916e9df0eff13cddc7312bb /global-functions
parent446d5c89fcc4f1fba7f8339e0ead23ba5720be5e (diff)
global-functions: $MkDir: rename internal variable
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions20
1 files changed, 10 insertions, 10 deletions
diff --git a/global-functions b/global-functions
index 71d711b..f0048dd 100644
--- a/global-functions
+++ b/global-functions
@@ -519,35 +519,35 @@
# create directory
:set MkDir do={
- :local Dir [ :tostr $1 ];
+ :local Path [ :tostr $1 ];
:global CleanFilePath;
:global GetRandom20CharAlNum;
:global LogPrintExit2;
:global WaitForFile;
- :set Dir [ $CleanFilePath $Dir ];
+ :set Path [ $CleanFilePath $Path ];
- :if ($Dir = "") do={
+ :if ($Path = "") do={
:return true;
}
- :if ([ :len [ /file/find where name=$Dir type="directory" ] ] = 1) do={
+ :if ([ :len [ /file/find where name=$Path type="directory" ] ] = 1) do={
:return true;
}
- :if ([ :len [ /file/find where name=$Dir ] ] = 1) do={
- $LogPrintExit2 warning $0 ("The path '" . $Dir . "' exists, but is not a directory.") false;
+ :if ([ :len [ /file/find where name=$Path ] ] = 1) do={
+ $LogPrintExit2 warning $0 ("The path '" . $Path . "' exists, but is not a directory.") false;
:return false;
}
:local Return true;
- :local Name ($Dir . "-" . [ $GetRandom20CharAlNum 6 ]);
+ :local Name ($Path . "-" . [ $GetRandom20CharAlNum 6 ]);
:do {
- /ip/smb/share/add disabled=yes directory=$Dir name=$Name;
- $WaitForFile $Dir;
+ /ip/smb/share/add disabled=yes directory=$Path name=$Name;
+ $WaitForFile $Path;
} on-error={
- $LogPrintExit2 warning $0 ("Making directory '" . $Dir . "' failed!") false;
+ $LogPrintExit2 warning $0 ("Making directory '" . $Path . "' failed!") false;
:set Return false;
}
/ip/smb/share/remove [ find where name=$Name ];