From 1dd1c5b03c73034aec739c7ca54c6372107969f6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 24 Aug 2023 15:49:41 +0200 Subject: backup-upload: write config file directly This functionality was added in RouterOS 7.9beta4... --- backup-upload.rsc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backup-upload.rsc') 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; \ -- cgit v1.2.3-70-g09d2