mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-03 09:44:58 +02:00
ppp-on-up: drop main function, use :do with on-error
This commit is contained in:
parent
1012d9fc51
commit
1db1a943e2
1 changed files with 5 additions and 6 deletions
|
@ -11,12 +11,13 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:local Interface $2;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global LogPrintExit2;
|
||||
|
||||
:local Interface $interface;
|
||||
|
||||
:if ([ :typeof $Interface ] = "nothing") do={
|
||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from ppp on-up script hook.") true;
|
||||
}
|
||||
|
@ -35,6 +36,4 @@
|
|||
$LogPrintExit2 warning $ScriptName ("Running script '" . $ScriptName . "' failed!") false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ] $interface;
|
||||
} on-error={ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue