mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-04-16 18:19:36 +00:00
ppp-on-up: early exit with :exit
This commit is contained in:
parent
f31ec1f411
commit
837a3a22fd
2 changed files with 4 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ Run scripts on ppp connection
|
||||||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||||
[](https://mikrotik.com/download/changelogs/)
|
[](https://mikrotik.com/download/changelogs/)
|
||||||
[](https://t.me/routeros_scripts)
|
[](https://t.me/routeros_scripts)
|
||||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@
|
||||||
# Copyright (c) 2013-2026 Christian Hesse <mail@eworm.de>
|
# Copyright (c) 2013-2026 Christian Hesse <mail@eworm.de>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.19
|
# requires RouterOS, version=7.22
|
||||||
#
|
#
|
||||||
# run scripts on ppp up
|
# run scripts on ppp up
|
||||||
# https://rsc.eworm.de/doc/ppp-on-up.md
|
# https://rsc.eworm.de/doc/ppp-on-up.md
|
||||||
|
|
||||||
:local ExitOK false;
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||||
|
|
@ -21,8 +20,7 @@
|
||||||
|
|
||||||
:if ([ :typeof $Interface ] = "nothing") do={
|
:if ([ :typeof $Interface ] = "nothing") do={
|
||||||
$LogPrint error $ScriptName ("This script is supposed to run from ppp on-up script hook.");
|
$LogPrint error $ScriptName ("This script is supposed to run from ppp on-up script hook.");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:local IntName [ /interface/get $Interface name ];
|
:local IntName [ /interface/get $Interface name ];
|
||||||
|
|
@ -40,5 +38,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} do={
|
} do={
|
||||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue