dhcp-lease-comment: simplify array access

This commit is contained in:
Christian Hesse 2019-01-15 10:34:22 +01:00
parent 07973066c9
commit cedc178595
3 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@
:local MacAddress [ / ip dhcp-server lease get $Lease mac-address ];
:local OldComment [ / ip dhcp-server lease get $Lease comment ];
:local NewComment;
:local AccessList [ :pick [ / caps-man access-list find where mac-address=$MacAddress ] 0 ];
:local AccessList ([ / caps-man access-list find where mac-address=$MacAddress ]->0);
:if ([ :len $AccessList ] > 0) do={
:set NewComment [ / caps-man access-list get $AccessList comment ];
}

View file

@ -10,7 +10,7 @@
:local MacAddress [ / ip dhcp-server lease get $Lease mac-address ];
:local OldComment [ / ip dhcp-server lease get $Lease comment ];
:local NewComment;
:local AccessList [ :pick [ / interface wireless access-list find where mac-address=$MacAddress ] 0 ];
:local AccessList ([ / interface wireless access-list find where mac-address=$MacAddress ]->0);
:if ([ :len $AccessList ] > 0) do={
:set NewComment [ / interface wireless access-list get $AccessList comment ];
}

View file

@ -11,7 +11,7 @@
:local MacAddress [ / ip dhcp-server lease get $Lease mac-address ];
:local OldComment [ / ip dhcp-server lease get $Lease comment ];
:local NewComment;
:local AccessList [ :pick [ / %PATH% access-list find where mac-address=$MacAddress ] 0 ];
:local AccessList ([ / %PATH% access-list find where mac-address=$MacAddress ]->0);
:if ([ :len $AccessList ] > 0) do={
:set NewComment [ / %PATH% access-list get $AccessList comment ];
}