global-{config,functions}: move variables, make independent

This commit is contained in:
Christian Hesse 2019-01-03 16:05:54 +01:00
parent 6e03a3b935
commit 7d06a7e8c2
4 changed files with 12 additions and 9 deletions

View file

@ -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
----------------

View file

@ -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;

View file

@ -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={

View file

@ -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;
}