From 3c7748cf6f08352975982a554d1162597801be56 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 19 Jan 2026 15:11:17 +0100 Subject: [PATCH] daily-psk: early exit with :exit --- daily-psk.capsman.rsc | 8 +++----- daily-psk.local.rsc | 8 +++----- daily-psk.template.rsc | 8 +++----- daily-psk.wifi.rsc | 8 +++----- doc/daily-psk.md | 2 +- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/daily-psk.capsman.rsc b/daily-psk.capsman.rsc index 2cee46ed..07603379 100644 --- a/daily-psk.capsman.rsc +++ b/daily-psk.capsman.rsc @@ -4,14 +4,13 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.19 +# requires RouterOS, version=7.22 # # update daily PSK (pre shared key) # https://rsc.eworm.de/doc/daily-psk.md # # !! Do not edit this file, it is generated from template! -:local ExitOK false; :onerror Err { :global GlobalConfigReady; :global GlobalFunctionsReady; :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ @@ -32,8 +31,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ - :set ExitOK true; - :error false; + :exit; } $WaitFullyConnected; @@ -92,5 +90,5 @@ } } } do={ - :global ExitError; $ExitError $ExitOK [ :jobname ] $Err; + :global ExitOnError; $ExitOnError [ :jobname ] $Err; } diff --git a/daily-psk.local.rsc b/daily-psk.local.rsc index fbf6dafe..5e522e1b 100644 --- a/daily-psk.local.rsc +++ b/daily-psk.local.rsc @@ -4,14 +4,13 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.19 +# requires RouterOS, version=7.22 # # update daily PSK (pre shared key) # https://rsc.eworm.de/doc/daily-psk.md # # !! Do not edit this file, it is generated from template! -:local ExitOK false; :onerror Err { :global GlobalConfigReady; :global GlobalFunctionsReady; :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ @@ -32,8 +31,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ - :set ExitOK true; - :error false; + :exit; } $WaitFullyConnected; @@ -91,5 +89,5 @@ } } } do={ - :global ExitError; $ExitError $ExitOK [ :jobname ] $Err; + :global ExitOnError; $ExitOnError [ :jobname ] $Err; } diff --git a/daily-psk.template.rsc b/daily-psk.template.rsc index 81244b86..1dfa89e2 100644 --- a/daily-psk.template.rsc +++ b/daily-psk.template.rsc @@ -4,7 +4,7 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.19 +# requires RouterOS, version=7.22 # # update daily PSK (pre shared key) # https://rsc.eworm.de/doc/daily-psk.md @@ -12,7 +12,6 @@ # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. -:local ExitOK false; :onerror Err { :global GlobalConfigReady; :global GlobalFunctionsReady; :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ @@ -33,8 +32,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ - :set ExitOK true; - :error false; + :exit; } $WaitFullyConnected; @@ -107,5 +105,5 @@ } } } do={ - :global ExitError; $ExitError $ExitOK [ :jobname ] $Err; + :global ExitOnError; $ExitOnError [ :jobname ] $Err; } diff --git a/daily-psk.wifi.rsc b/daily-psk.wifi.rsc index 636e9f43..02feefb4 100644 --- a/daily-psk.wifi.rsc +++ b/daily-psk.wifi.rsc @@ -4,14 +4,13 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.19 +# requires RouterOS, version=7.22 # # update daily PSK (pre shared key) # https://rsc.eworm.de/doc/daily-psk.md # # !! Do not edit this file, it is generated from template! -:local ExitOK false; :onerror Err { :global GlobalConfigReady; :global GlobalFunctionsReady; :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ @@ -32,8 +31,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ - :set ExitOK true; - :error false; + :exit; } $WaitFullyConnected; @@ -92,5 +90,5 @@ } } } do={ - :global ExitError; $ExitError $ExitOK [ :jobname ] $Err; + :global ExitOnError; $ExitOnError [ :jobname ] $Err; } diff --git a/doc/daily-psk.md b/doc/daily-psk.md index 7ddb4d98..ab56ce29 100644 --- a/doc/daily-psk.md +++ b/doc/daily-psk.md @@ -4,7 +4,7 @@ Use wireless network with daily psk [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.19-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.22-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)