-#!rsc by Vados\r
-# RouterOS script: AM-GlobalConfig\r
-# Script comment: Global Config Script\r
-# Copyright (c) 2007-2026 Vados <vados@vados.ru>\r
-#\r
-#\r
-# Warning: Dont touch this line!\r
-:global GlobalConfReady false;\r
-#\r
-#\r
-# Global Url For Amster scripts to fetch\r
-# most be defined in AM-Init-Script or AM-setup scripts\r
-:global GlobalScriptsUrl "https://ros.vados.ru/";\r
-:global ScriptsUrlSuffix "";\r
-:global CheckSumsVerify true;\r
-\r
-:global ScriptUpdatesCRLF true;\r
-:global CommentsInScripts true;\r
-\r
-# Debug output:\r
-:global PrintDebug true; #false;\r
-\r
-# Debug output for specific script:\r
-:set ($PrintDebugOverride->"AM-GlobalFunc") true;\r
-\r
-# Debug logs\r
-# Other actions (disk, email, remote or support) can be used as well.\r
-# I do not recommend using echo - use debug output instead (https://rsc.eworm.de/main/DEBUG.html#debug-output).\r
-#/system/logging/add topics=script,debug action=memory;\r
-\r
-:global MikrotikUpgradeUrl "https://upgrade.mikrotik.com/routeros";\r
-:global Domain "WORKGROUP";\r
-\r
-:global EmailGeneralTo "vados@vados.ru";\r
-#:global EmailGeneralCc "";\r
-\r
-# $ScriptInstallUpdate mod/notification-telegram\r
-:global TelegramTokenId "8390868324:AAG3_d1hfVR2M6pGAgDK6ZvhOe4J97nyopw";\r
-:global TelegramChatId "-1003631309063"; #"454403445";\r
-# Use this to send notifications to a specific topic in group.\r
-#:global TelegramThreadId "30";\r
-# Using telegram-chat you have to define trusted chat ids (not group ids!)\r
-# or user names. Groups allow to chat with devices simultaneously.\r
-:global TelegramChatIdsTrusted {\r
- "454403445"\r
- "-1003631309063"\r
- "-5124482807"\r
- "1087968824";\r
-};\r
-# "-5294757340";\r
-\r
-:global TelegramChatGroups "(all)";\r
-#:global TelegramChatGroups "(all|home|office)";\r
-\r
-:global NotificationFunctions {\r
- "email"\r
- "telegram";\r
-};\r
-# Toggle this to disable symbols in notifications.\r
-:global NotificationsWithSymbols true;\r
-:global TerminalColorOutput true;\r
-\r
-:global DetectIpAddrDefault "https://ipv4.mikrotik.ovh/";\r
-:global DetectIpAddrFallback "https://api.ipify.org/";\r
-\r
-## Update channel. Possible values: stable, long-term, testing, development\r
-:global updateChannel "stable";\r
-\r
-# Script BackupAndUpdate mode, possible values: backup,\r
-# updateOnce - Update once as "osnotify" and back "osnotify" mode (in terminal run :set OSUpdateMode updateOnce; $OSUpdateMode;). \r
-# osupdate - Update if available and creates backups before/after update (ignores `forceBackup`)\r
-# Set `forceBackup` to true to always create backups, even without updates\r
-# osnotify - Set `forceBackup` to always create backups on every run\r
-:global DevInfoIncludeIP true;\r
-:global BackupAndUpdateMode "osnotify"\r
-\r
-:global forceBackup true;\r
-:global BackupPassword "Peskar55";\r
-\r
-# SFTP Backup Variables\r
-:global BackupRandomDelay 0;\r
-:global BackupUploadUrl "sftp://amster.vados.ru/upload/";\r
-:global BackupUploadUser $Identity;\r
-:global BackupUploadPass "root.mnuc.backuper";\r
-\r
-:global BackupSendBinary true;\r
-:global BackupSendExport true;\r
-:global BackupSendGlobalConfig true;\r
-:global BackupSendScripts true;\r
-\r
-# Remove local file after uploading if no errors\r
-:global BackupRmLocal true;\r
-\r
-# Local Backups Root Directory \r
-:global BackupLocalRoot "tmpfs";\r
-\r
-# Encrypt Backup\r
-:global BackupEncrypt true;\r
-\r
-# Sensitive information in Backups\r
-:global BackupSens true;\r
-\r
-# User Export\r
-:global BackupUser true;\r
-\r
-# License Export (not for CHR, will silently skip)\r
-:global BackupLicense false;\r
-\r
-# SSH Keys\r
-:global BackupSshKeys true;\r
-\r
-# Certificate Export\r
-:global BackupCerts true;\r
-\r
-# Certificate Password\r
-:global BackupCertsPasswd "";\r
-\r
-# User-Manager Export\r
-:global BackupUserMan false;\r
-\r
-# The Dude Export\r
-:global BackupDude false;\r
-\r
-# User Files to export, comma-separated string or array of strings\r
-# User Files are not removed on backup\r
-# Any directory paths will be removed (/ -> _) on remote file\r
-# Nonpresent files are silently skipped\r
-:global BackupUserList "autosupout.rif,autosupout.old.rif";\r
-\r
-# load functions and any custom scripts\r
-# [ /system/script/find where name="global-config-overlay" ], \\r
-# [ /system/script/find where name~"^global-config-overlay\\.d/." ]\r
-#\r
-#:foreach Script in=([ /system/script/find where name="Amster-TGglobalVars" ], [ /system/script/find where name="Amster-TGglobalFunc" ]) do={\r
-# :onerror Err {\r
-# /system/script/run $Script;\r
-# } do={\r
-# :log error ("Loading configuration from configs and functions" . [ /system/script/get $Script name ] . " failed: " . $Err);\r
-# }\r
-#}\r
-#:log info "\ndevMode = $devMode";\r
-#:log info "\ndevRunning = $devRunning";\r
-:foreach Script in=[ /system/script/find where source~"^#!rsc by Vados GlobalRUN\r?\n" ] do={\r
- :onerror Err {\r
- /system/script/run $Script;\r
- } do={\r
- :log error ("Run script " . [ /system/script/get $Script name ] . " width marker \" GlobalRUN\" failed: " . $Err);\r
- }\r
-}\r
-\r
-# signal we are ready\r
-:set GlobalConfReady true;\r
-:while ($GlobalConfReady != true) do={:delay 500ms};\r
+#!rsc by Vados
+# RouterOS script: AM-GlobalConfig
+# Script comment: Global Config Script
+# Copyright (c) 2007-2026 Vados <vados@vados.ru>
+#
+#
+# Warning: Dont touch this line!
+:global GlobalConfReady false;
+#
+#
+# Global Url For Amster scripts to fetch
+# most be defined in AM-Init-Script or AM-setup scripts
+:global GlobalScriptsUrl "https://ros.vados.ru/";
+:global ScriptsUrlSuffix "";
+:global CheckSumsVerify true;
+
+:global ScriptUpdatesCRLF true;
+:global CommentsInScripts true;
+
+# Debug output:
+:global PrintDebug true; #false;
+
+# Debug output for specific script:
+:set ($PrintDebugOverride->"AM-GlobalFunc") true;
+
+# Debug logs
+# Other actions (disk, email, remote or support) can be used as well.
+# I do not recommend using echo - use debug output instead (https://rsc.eworm.de/main/DEBUG.html#debug-output).
+#/system/logging/add topics=script,debug action=memory;
+
+:global MikrotikUpgradeUrl "https://upgrade.mikrotik.com/routeros";
+:global Domain "WORKGROUP";
+
+:global EmailGeneralTo "vados@vados.ru";
+#:global EmailGeneralCc "";
+
+# $ScriptInstallUpdate mod/notification-telegram
+:global TelegramTokenId "8390868324:AAG3_d1hfVR2M6pGAgDK6ZvhOe4J97nyopw";
+:global TelegramChatId "-1003631309063"; #"454403445";
+# Use this to send notifications to a specific topic in group.
+#:global TelegramThreadId "30";
+# Using telegram-chat you have to define trusted chat ids (not group ids!)
+# or user names. Groups allow to chat with devices simultaneously.
+:global TelegramChatIdsTrusted {
+ "454403445"
+ "-1003631309063"
+ "-5124482807"
+ "1087968824";
+};
+# "-5294757340";
+
+:global TelegramChatGroups "(all)";
+#:global TelegramChatGroups "(all|home|office)";
+
+:global NotificationFunctions {
+ "email"
+ "telegram";
+};
+# Toggle this to disable symbols in notifications.
+:global NotificationsWithSymbols true;
+:global TerminalColorOutput true;
+
+:global DetectIpAddrDefault "https://ipv4.mikrotik.ovh/";
+:global DetectIpAddrFallback "https://api.ipify.org/";
+
+## Update channel. Possible values: stable, long-term, testing, development
+:global updateChannel "stable";
+
+# Script BackupAndUpdate mode, possible values: backup,
+# updateOnce - Update once as "osnotify" and back "osnotify" mode (in terminal run :set OSUpdateMode updateOnce; $OSUpdateMode;).
+# osupdate - Update if available and creates backups before/after update (ignores `forceBackup`)
+# Set `forceBackup` to true to always create backups, even without updates
+# osnotify - Set `forceBackup` to always create backups on every run
+:global DevInfoIncludeIP true;
+:global BackupAndUpdateMode "osnotify"
+
+:global forceBackup true;
+:global BackupPassword "Peskar55";
+
+# SFTP Backup Variables
+:global BackupRandomDelay 0;
+:global BackupUploadUrl "sftp://amster.vados.ru/upload/";
+:global BackupUploadUser $Identity;
+:global BackupUploadPass "root.mnuc.backuper";
+
+:global BackupSendBinary true;
+:global BackupSendExport true;
+:global BackupSendGlobalConfig true;
+:global BackupSendScripts true;
+
+# Remove local file after uploading if no errors
+:global BackupRmLocal true;
+
+# Local Backups Root Directory
+:global BackupLocalRoot "tmpfs";
+
+# Encrypt Backup
+:global BackupEncrypt true;
+
+# Sensitive information in Backups
+:global BackupSens true;
+
+# User Export
+:global BackupUser true;
+
+# License Export (not for CHR, will silently skip)
+:global BackupLicense false;
+
+# SSH Keys
+:global BackupSshKeys true;
+
+# Certificate Export
+:global BackupCerts true;
+
+# Certificate Password
+:global BackupCertsPasswd "";
+
+# User-Manager Export
+:global BackupUserMan false;
+
+# The Dude Export
+:global BackupDude false;
+
+# User Files to export, comma-separated string or array of strings
+# User Files are not removed on backup
+# Any directory paths will be removed (/ -> _) on remote file
+# Nonpresent files are silently skipped
+:global BackupUserList "autosupout.rif,autosupout.old.rif";
+
+# load functions and any custom scripts
+# [ /system/script/find where name="global-config-overlay" ], \
+# [ /system/script/find where name~"^global-config-overlay\\.d/." ]
+#
+#:foreach Script in=([ /system/script/find where name="Amster-TGglobalVars" ], [ /system/script/find where name="Amster-TGglobalFunc" ]) do={
+# :onerror Err {
+# /system/script/run $Script;
+# } do={
+# :log error ("Loading configuration from configs and functions" . [ /system/script/get $Script name ] . " failed: " . $Err);
+# }
+#}
+#:log info "\ndevMode = $devMode";
+#:log info "\ndevRunning = $devRunning";
+:foreach Script in=[ /system/script/find where source~"^#!rsc by Vados GlobalRUN\r?\n" ] do={
+ :onerror Err {
+ /system/script/run $Script;
+ } do={
+ :log error ("Run script " . [ /system/script/get $Script name ] . " width marker \" GlobalRUN\" failed: " . $Err);
+ }
+}
+
+# signal we are ready
+:set GlobalConfReady true;
+:while ($GlobalConfReady != true) do={:delay 500ms};