mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
ppp-on-up: switch to $LogPrint
This commit is contained in:
@ -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={ }
|
||||
|
Reference in New Issue
Block a user