mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-30 15:54:56 +02:00
backup-upload: write config file directly
This functionality was added in RouterOS 7.9beta4...
This commit is contained in:
parent
16844b935a
commit
1dd1c5b03c
1 changed files with 5 additions and 5 deletions
|
@ -100,13 +100,13 @@ $WaitFullyConnected;
|
|||
|
||||
# global-config-overlay
|
||||
:if ($BackupSendGlobalConfig = true) do={
|
||||
:execute script={ :put [ /system/script/get global-config-overlay source ]; } \
|
||||
file=($FilePath . ".conf");
|
||||
$WaitForFile ($FilePath . ".conf.txt");
|
||||
:local Config [ /system/script/get global-config-overlay source ];
|
||||
/file/add name=($FilePath . ".conf") contents=$Config;
|
||||
$WaitForFile ($FilePath . ".conf");
|
||||
|
||||
:do {
|
||||
/tool/fetch upload=yes url=($BackupUploadUrl . "/" . $FileName . ".conf") \
|
||||
user=$BackupUploadUser password=$BackupUploadPass src-path=($FilePath . ".conf.txt");
|
||||
user=$BackupUploadUser password=$BackupUploadPass src-path=($FilePath . ".conf");
|
||||
:set ConfigFile ($FileName . ".conf");
|
||||
} on-error={
|
||||
$LogPrintExit2 error $0 ("Uploading global-config-overlay failed!") false;
|
||||
|
@ -114,7 +114,7 @@ $WaitFullyConnected;
|
|||
:set Failed 1;
|
||||
}
|
||||
|
||||
/file/remove ($FilePath . ".conf.txt");
|
||||
/file/remove ($FilePath . ".conf");
|
||||
}
|
||||
|
||||
$SendNotification2 ({ origin=$0; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue