mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-02 01:04:55 +02:00
dhcp-lease-comment: drop main function, use :do with on-error
This commit is contained in:
parent
f79206a9b8
commit
0d1c4cece2
4 changed files with 16 additions and 24 deletions
|
@ -14,14 +14,14 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
|
@ -36,6 +36,4 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ];
|
||||
} on-error={ }
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
|
@ -36,6 +36,4 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ];
|
||||
} on-error={ }
|
||||
|
|
|
@ -15,14 +15,14 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
|
@ -41,6 +41,4 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ];
|
||||
} on-error={ }
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
|
@ -36,6 +36,4 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ];
|
||||
} on-error={ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue