aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-08-24 15:49:41 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-08-29 08:58:50 +0200
commit1dd1c5b03c73034aec739c7ca54c6372107969f6 (patch)
treeddbf7308e8f243c2f4430605fe99699d39fdf9b2
parent16844b935af98eaabf6db1db96a88ff39819a3df (diff)
backup-upload: write config file directlyrouteros-7.9beta4-7
This functionality was added in RouterOS 7.9beta4...
-rw-r--r--backup-upload.rsc10
1 files changed, 5 insertions, 5 deletions
diff --git a/backup-upload.rsc b/backup-upload.rsc
index 1ec61a5..35b9b53 100644
--- a/backup-upload.rsc
+++ b/backup-upload.rsc
@@ -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; \