mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-24 04:44:26 +02:00
ppp-on-up: switch to $LogPrint
This commit is contained in:
parent
8444e5f270
commit
88d4c0aff8
1 changed files with 6 additions and 5 deletions
|
@ -14,26 +14,27 @@
|
|||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global LogPrint;
|
||||
|
||||
:local Interface $interface;
|
||||
|
||||
:if ([ :typeof $Interface ] = "nothing") do={
|
||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from ppp on-up script hook.") true;
|
||||
$LogPrint error $ScriptName ("This script is supposed to run from ppp on-up script hook.");
|
||||
:error false;
|
||||
}
|
||||
|
||||
:local IntName [ /interface/get $Interface name ];
|
||||
$LogPrintExit2 info $ScriptName ("PPP interface " . $IntName . " is up.") false;
|
||||
$LogPrint info $ScriptName ("PPP interface " . $IntName . " is up.");
|
||||
|
||||
/ipv6/dhcp-client/release [ find where interface=$IntName !disabled ];
|
||||
|
||||
:foreach Script in=[ /system/script/find where source~("\n# provides: ppp-on-up\n") ] do={
|
||||
:local ScriptName [ /system/script/get $Script name ];
|
||||
:do {
|
||||
$LogPrintExit2 debug $ScriptName ("Running script: " . $ScriptName) false;
|
||||
$LogPrint debug $ScriptName ("Running script: " . $ScriptName);
|
||||
/system/script/run $Script;
|
||||
} on-error={
|
||||
$LogPrintExit2 warning $ScriptName ("Running script '" . $ScriptName . "' failed!") false;
|
||||
$LogPrint warning $ScriptName ("Running script '" . $ScriptName . "' failed!");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue