global-functions: $MkDir: log error

This commit is contained in:
Christian Hesse 2021-12-13 23:54:30 +01:00
parent e111832462
commit 5846b85e28

View file

@ -495,6 +495,7 @@
:global CleanFilePath; :global CleanFilePath;
:global GetRandom20CharHex; :global GetRandom20CharHex;
:global LogPrintExit2;
:global WaitForFile; :global WaitForFile;
:set Dir [ $CleanFilePath $Dir ]; :set Dir [ $CleanFilePath $Dir ];
@ -504,11 +505,12 @@
} }
:local Return true; :local Return true;
:local Name ($Dir . "-" . [ $GetRandom20CharHex ]) :local Name ($Dir . "-" . [ $GetRandom20CharHex ]);
:do { :do {
/ ip smb share add disabled=yes directory=$Dir name=$Name; / ip smb share add disabled=yes directory=$Dir name=$Name;
$WaitForFile $Dir; $WaitForFile $Dir;
} on-error={ } on-error={
$LogPrintExit2 warning $0 ("Making directory '" . $Dir . "' failed!") false;
:set Return false; :set Return false;
} }
/ ip smb share remove [ find where name=$Name ]; / ip smb share remove [ find where name=$Name ];