diff options
author | Christian Hesse <mail@eworm.de> | 2021-02-22 15:14:10 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-02-24 21:51:54 +0100 |
commit | f46db918453dcb8878b9a0de6e122fb0ea2224d9 (patch) | |
tree | 31544a450651d0705ecdea0c3d35e650ef784d67 /upload-backup | |
parent | b0e52aa2d1baa78fc9d025c0671fea8babba0ec2 (diff) |
global: give script or function name in log messages
Diffstat (limited to 'upload-backup')
-rw-r--r-- | upload-backup | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/upload-backup b/upload-backup index e16a4e5..1e3e8e8 100644 --- a/upload-backup +++ b/upload-backup @@ -6,6 +6,7 @@ # create and upload backup and config file # https://git.eworm.de/cgit/routeros-scripts/about/doc/upload-backup.md +:local 0 "upload-backup"; :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } @@ -21,7 +22,7 @@ :global CharacterReplace; :global DeviceInfo; :global IfThenElse; -:global LogPrintExit; +:global LogPrintExit2; :global SendNotification; :global SymbolForNotification; :global WaitForFile; @@ -31,7 +32,7 @@ $WaitFullyConnected; :if ($BackupSendBinary != true && \ $BackupSendExport != true) do={ - $LogPrintExit error ("Configured to send neither backup nor config export.") true; + $LogPrintExit2 error $0 ("Configured to send neither backup nor config export.") true; } # filename based on identity @@ -50,7 +51,7 @@ $WaitFullyConnected; user=$BackupUploadUser password=$BackupUploadPass src-path=($FileName . ".backup"); :set BackupFile ($FileName . ".backup"); } on-error={ - $LogPrintExit error ("Uploading backup file failed!") false; + $LogPrintExit2 error $0 ("Uploading backup file failed!") false; :set BackupFile "failed"; :set Failed 1; } @@ -66,7 +67,7 @@ $WaitFullyConnected; user=$BackupUploadUser password=$BackupUploadPass src-path=($FileName . ".rsc"); :set ConfigFile ($FileName . ".rsc"); } on-error={ - $LogPrintExit error ("Uploading configuration export failed!") false; + $LogPrintExit2 error $0 ("Uploading configuration export failed!") false; :set ConfigFile "failed"; :set Failed 1; } |