Community discussions

MikroTik App
 
hngjared
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Thu Dec 01, 2011 8:36 pm
Location: NYC USA

Lease-Script local/global variables Problems

Mon Apr 11, 2022 6:44 pm

We received some new hardware with factory default ROS v7. It appears the dhcp server, lease-script is no longer taking local/global variables? Has anyone found a fix for this? See below for script.

{
:local mac "$leaseActMAC"
:local host $"lease-hostname"
:if ([:pick $host 0 4] = "test" || [:pick $host 0 4] = "exam") do={
/ip hotspot ip-binding add mac-address=$mac server="all" comment="test" type="bypassed";
}
}
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Lease-Script local/global variables Problems

Mon Apr 11, 2022 7:32 pm

work if the variables are not used?
:if (([:pick $"lease-hostname" 0 4] = "test") or ([:pick $"lease-hostname" 0 4] = "exam")) do={
    /ip hotspot ip-binding add mac-address=$leaseActMAC server=all comment="test" type=bypassed
}
 
hngjared
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Thu Dec 01, 2011 8:36 pm
Location: NYC USA

Re: Lease-Script local/global variables Problems

Mon Apr 11, 2022 7:44 pm

Thanks Rex!

Who is online

Users browsing this forum: No registered users and 25 guests