mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-{config,functions}: move variables, make independent
This commit is contained in:
@ -85,10 +85,12 @@ your mails to `mail@example.com`!
|
|||||||
|
|
||||||
[admin@MikroTik] > / system script edit global-config source
|
[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-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-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
|
Updating scripts
|
||||||
----------------
|
----------------
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
# Make sure all configuration properties are up to date and this
|
# Make sure all configuration properties are up to date and this
|
||||||
# value is in sync with value in script 'global-functions'!
|
# value is in sync with value in script 'global-functions'!
|
||||||
:global GlobalConfigVersion 0;
|
:global GlobalConfigVersion 1;
|
||||||
|
|
||||||
# This is used for DNS and backup file.
|
# This is used for DNS and backup file.
|
||||||
:global "domain" "example.com";
|
:global "domain" "example.com";
|
||||||
@ -105,9 +105,3 @@
|
|||||||
#:global tunnelpass "v3ry-s3cr3t";
|
#:global tunnelpass "v3ry-s3cr3t";
|
||||||
#:global tunnelid "user-XXX.tunnel.tserv6.fra1.ipv6.he.net";
|
#:global tunnelid "user-XXX.tunnel.tserv6.fra1.ipv6.he.net";
|
||||||
#:global tunnelint "tunnelbroker";
|
#: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;
|
|
||||||
|
@ -5,7 +5,12 @@
|
|||||||
# global functions
|
# global functions
|
||||||
|
|
||||||
# expected configuration version
|
# 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
|
# read input from user
|
||||||
:global Read do={
|
:global Read do={
|
||||||
|
@ -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 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-config;
|
||||||
|
/ system script run global-functions;
|
||||||
/ system scheduler add name=global-config start-time=startup on-event=global-config;
|
/ 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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user