mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-30 05:04:26 +02:00
global-functions: $MkDir: log error
This commit is contained in:
parent
e111832462
commit
5846b85e28
1 changed files with 3 additions and 1 deletions
|
@ -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 ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue