From aad2e062e5005a1acdc689a4042d8c80d025b667 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 23 Jun 2021 10:19:59 +0200 Subject: ppp-on-up: use 'provides' to find ppp-on-up scripts --- ppp-on-up | 13 ++++--------- update-tunnelbroker | 2 ++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ppp-on-up b/ppp-on-up index fe1492d..e7b2971 100644 --- a/ppp-on-up +++ b/ppp-on-up @@ -23,13 +23,8 @@ / ipv6 dhcp-client release [ find where interface=$IntName !disabled ]; -:local Scripts { - "update-tunnelbroker" -} - -:foreach Script in=$Scripts do={ - :if ([ :len [ / system script find where name=$Script ] ] > 0) do={ - :log debug ("Running script from ppp-on-up: " . $Script); - / system script run $Script; - } +:foreach Script in=[ / system script find where source~("\n# provides: ppp-on-up\n") ] do={ + :local ScriptName [ / system script get $Script name ]; + :log debug ("Running script from ppp-on-up: " . $ScriptName); + / system script run $Script; } diff --git a/update-tunnelbroker b/update-tunnelbroker index e6f50e4..4924516 100644 --- a/update-tunnelbroker +++ b/update-tunnelbroker @@ -4,6 +4,8 @@ # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # +# provides: ppp-on-up +# # update local address of tunnelbroker interface # https://git.eworm.de/cgit/routeros-scripts/about/doc/update-tunnelbroker.md -- cgit v1.2.3-70-g09d2