mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-30 15:54:56 +02:00
global-functions: $MkDir: :do ... on-error=... -> :onerror ... do=...
This commit is contained in:
parent
7a1fef78a2
commit
09f9826760
1 changed files with 6 additions and 6 deletions
|
@ -894,11 +894,11 @@
|
|||
|
||||
$LogPrint info $0 ("Creating disk of type tmpfs.");
|
||||
$RmDir "tmpfs";
|
||||
:do {
|
||||
:onerror Err {
|
||||
/disk/add slot=tmpfs type=tmpfs tmpfs-max-size=([ /system/resource/get total-memory ] / 3);
|
||||
$WaitForFile "tmpfs";
|
||||
} on-error={
|
||||
$LogPrint warning $0 ("Creating disk of type tmpfs failed!");
|
||||
} do={
|
||||
$LogPrint warning $0 ("Creating disk of type tmpfs failed: " . $Err);
|
||||
:return false;
|
||||
}
|
||||
:return true;
|
||||
|
@ -923,11 +923,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
:do {
|
||||
:onerror Err {
|
||||
/file/add type="directory" name=$Path;
|
||||
$WaitForFile $Path;
|
||||
} on-error={
|
||||
$LogPrint warning $0 ("Making directory '" . $Path . "' failed!");
|
||||
} do={
|
||||
$LogPrint warning $0 ("Making directory '" . $Path . "' failed: " . $Err);
|
||||
:return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue