From 1e72f03e5e568cec4c9850db1770e6f130446cc5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2020 22:10:33 +0100 Subject: README: update instructions to use $ScriptInstallUpdate --- README.md | 16 +++++++++------- global-config | 2 +- global-config-overlay | 2 +- global-config.changes | 1 + global-functions | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ec1654e..d35d4c4 100644 --- a/README.md +++ b/README.md @@ -105,14 +105,17 @@ To update existing scripts just run `script-updates`. [admin@MikroTik] > / system script run script-updates +Calling function `$ScriptInstallUpdate` does the same. + + [admin@MikroTik] > $ScriptInstallUpdate + Adding a script --------------- -To add a script from the repository create a configuration item first, then -update scripts to fetch the source. +To add a script from the repository run function `$ScriptInstallUpdate` with +a comma separated list of script names. - [admin@MikroTik] > / system script add name="check-routeros-update" - [admin@MikroTik] > / system script run script-updates + [admin@MikroTik] > $ScriptInstallUpdate check-certificates,check-routeros-update Scheduler and events -------------------- @@ -128,9 +131,8 @@ Some events can run a script. If you want your DHCP hostnames to be available in DNS use `dhcp-to-dns` with the events from dhcp server. For a regular cleanup add a scheduler entry. - [admin@MikroTik] > / system script add name="dhcp-to-dns" - [admin@MikroTik] > / system script run script-updates - [admin@MikroTik] > / ip dhcp-server set lease-script=dhcp-to-dns [ find ] + [admin@MikroTik] > $ScriptInstallUpdate dhcp-to-dns,lease-script + [admin@MikroTik] > / ip dhcp-server set lease-script=lease-script [ find ] [admin@MikroTik] > / system scheduler add name="dhcp-to-dns" interval=5m on-event="/ system script run dhcp-to-dns;" There's much more to explore... Have fun! diff --git a/global-config b/global-config index aa125f2..95db1c5 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 10; +:global GlobalConfigVersion 11; # This is used for DNS and backup file. :global Domain "example.com"; diff --git a/global-config-overlay b/global-config-overlay index 1b07f15..59d6ddb 100644 --- a/global-config-overlay +++ b/global-config-overlay @@ -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 10; +:global GlobalConfigVersion 11; # The global-config script is updated by script-updates, # global-config-overlay becomes an overlay for your changes. diff --git a/global-config.changes b/global-config.changes index 04ab34f..a8b8126 100644 --- a/global-config.changes +++ b/global-config.changes @@ -13,4 +13,5 @@ 8="added donation hint and option to silence it"; 9="introduced configuration overlay 'global-config-overlay'"; 10="make health threshold for voltage configurable"; + 11="introduced function '\$ScriptInstallUpdate' to install new and update existing scripts"; }; diff --git a/global-functions b/global-functions index 60f72a4..796bd0e 100644 --- a/global-functions +++ b/global-functions @@ -6,7 +6,7 @@ # global functions # expected configuration version -:global ExpectedConfigVersion 10; +:global ExpectedConfigVersion 11; # global variables not to be changed by user :global SentConfigChangesNotification "-"; -- cgit v1.2.3-54-g00ecf