mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-10 18:14:27 +02:00
backup-email: detect failure creating config file
This commit is contained in:
parent
ffc7521a35
commit
07c6f5836a
1 changed files with 10 additions and 2 deletions
|
@ -85,8 +85,16 @@ $WaitFullyConnected;
|
||||||
:local Config [ /system/script/get global-config-overlay source ];
|
:local Config [ /system/script/get global-config-overlay source ];
|
||||||
/file/add name=($FilePath . ".conf") contents=$Config;
|
/file/add name=($FilePath . ".conf") contents=$Config;
|
||||||
$WaitForFile ($FilePath . ".conf");
|
$WaitForFile ($FilePath . ".conf");
|
||||||
:set ConfigFile ($FileName . ".conf");
|
|
||||||
:set Attach ($Attach, ($FilePath . ".conf"));
|
:local Size [ :len $Config ];
|
||||||
|
:if ([ /file/get ($FilePath . ".conf") size ] = $Size) do={
|
||||||
|
:set ConfigFile ($FileName . ".conf");
|
||||||
|
:set Attach ($Attach, ($FilePath . ".conf"));
|
||||||
|
} else={
|
||||||
|
$LogPrintExit2 warning $0 ("Creating config file failed. Size should be " . $Size . " bytes, but is not.") false;
|
||||||
|
:set ConfigFile "failed";
|
||||||
|
:set Failed 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# send email with status and files
|
# send email with status and files
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue