From 7d06a7e8c2b66a12db65130bddb3578b3f04468f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 3 Jan 2019 16:05:54 +0100 Subject: global-{config,functions}: move variables, make independent --- README.md | 4 +++- global-config | 8 +------- global-functions | 7 ++++++- initial-commands | 2 ++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0498b32..6eba673 100644 --- a/README.md +++ b/README.md @@ -85,10 +85,12 @@ your mails to `mail@example.com`! [admin@MikroTik] > / system script edit global-config source -And finally load the configuration and add a scheduler. +And finally load configuration and functions and add the schedulers. [admin@MikroTik] > / system script run global-config + [admin@MikroTik] > / system script run global-functions [admin@MikroTik] > / system scheduler add name=global-config start-time=startup on-event=global-config + [admin@MikroTik] > / system scheduler add name=global-functions start-time=startup on-event=global-functions Updating scripts ---------------- diff --git a/global-config b/global-config index b77336c..448fbea 100644 --- a/global-config +++ b/global-config @@ -6,7 +6,7 @@ # Make sure all configuration properties are up to date and this # value is in sync with value in script 'global-functions'! -:global GlobalConfigVersion 0; +:global GlobalConfigVersion 1; # This is used for DNS and backup file. :global "domain" "example.com"; @@ -105,9 +105,3 @@ #:global tunnelpass "v3ry-s3cr3t"; #:global tunnelid "user-XXX.tunnel.tserv6.fra1.ipv6.he.net"; #:global tunnelint "tunnelbroker"; - -# Do *NOT* change these! -:global "sent-routeros-update-notification" "-"; -:global "sent-lte-firmware-upgrade-notification" "-"; -:global "identity" [ / system identity get name ]; -/ system script run global-functions; diff --git a/global-functions b/global-functions index 2c559ae..8b98507 100644 --- a/global-functions +++ b/global-functions @@ -5,7 +5,12 @@ # global functions # expected configuration version -:global ExpectedConfigVersion 0; +:global ExpectedConfigVersion 1; + +# global variables not to be changed by user +:global "sent-routeros-update-notification" "-"; +:global "sent-lte-firmware-upgrade-notification" "-"; +:global "identity" [ / system identity get name ]; # read input from user :global Read do={ diff --git a/initial-commands b/initial-commands index e08b363..ad44ebb 100644 --- a/initial-commands +++ b/initial-commands @@ -16,5 +16,7 @@ / system script add name=$script source=([ / tool fetch check-certificate=yes-without-crl ("https://git.eworm.de/cgit.cgi/routeros-scripts/plain/" . $script) output=user as-value]->"data"); } / system script run global-config; + / system script run global-functions; / system scheduler add name=global-config start-time=startup on-event=global-config; + / system scheduler add name=global-functions start-time=startup on-event=global-functions; } -- cgit v1.2.3-54-g00ecf