diff --git a/dhcpv6-client-lease.rsc b/dhcpv6-client-lease.rsc index d3c1b9aa..2a70a977 100644 --- a/dhcpv6-client-lease.rsc +++ b/dhcpv6-client-lease.rsc @@ -3,12 +3,11 @@ # Copyright (c) 2026 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.19 +# requires RouterOS, version=7.22 # # run scripts on IPv6 DHCP client lease # https://rsc.eworm.de/doc/dhcpv6-client-lease.md -:local ExitOK false; :onerror Err { :global GlobalConfigReady; :global GlobalFunctionsReady; :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ @@ -21,15 +20,13 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ - :set ExitOK true; - :error false; + :exit; } :if (([ :typeof $"na-address" ] = "nothing" || [ :typeof $"na-valid" ] = "nothing") && \ ([ :typeof $"pd-prefix" ] = "nothing" || [ :typeof $"pd-valid" ] = "nothing")) do={ $LogPrint error $ScriptName ("This script is supposed to run from ipv6 dhcp-client."); - :set ExitOK true; - :error false; + :exit; } :global DHCPv6ClientLeaseVars { @@ -59,5 +56,5 @@ :set DHCPv6ClientLeaseVars; } do={ :global DHCPv6ClientLeaseVars; :set DHCPv6ClientLeaseVars; - :global ExitError; $ExitError $ExitOK [ :jobname ] $Err; + :global ExitOnError; $ExitOnError [ :jobname ] $Err; } diff --git a/doc/dhcpv6-client-lease.md b/doc/dhcpv6-client-lease.md index c126f2d4..6e8cb28c 100644 --- a/doc/dhcpv6-client-lease.md +++ b/doc/dhcpv6-client-lease.md @@ -4,7 +4,7 @@ Run other scripts on IPv6 DHCP client lease [![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)