Changeset 208 for trunk/system/generators/dhcp_routerboard.php
- Timestamp:
- May 6, 2009, 8:21:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/dhcp_routerboard.php
r197 r208 12 12 $Commands = array(); 13 13 $Commands[] = '/ip dhcp-server lease { remove [find server=dhcp'.$I.']}'; 14 $DbResult2 = $Database->query('SELECT * FROM `hosts` WHERE (`IP` LIKE "192.168.'.$I.'.%") AND (`MAC` != "00:00:00:00:00:00") ORDER BY `IP`');15 while($ Host= $DbResult2->fetch_assoc())14 $DbResult2 = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM `NetworkInterface` LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE (`LocalIP` LIKE "192.168.'.$I.'.%") AND (`MAC` != "00:00:00:00:00:00") ORDER BY `LocalIP`'); 15 while($Interface = $DbResult2->fetch_assoc()) 16 16 { 17 $Commands[] = '/ip dhcp-server lease add mac-address='.$ Host['MAC'].' address='.$Host['IP'].' server=dhcp'.$I.' comment='.$Host['name'];17 $Commands[] = '/ip dhcp-server lease add mac-address='.$Interface['MAC'].' address='.$Interface['LocalIP'].' server=dhcp'.$I.' comment='.$Interface['DeviceName'].'-'.$Interface['Name']; 18 18 } 19 19 $Commands = implode(';', $Commands);
Note:
See TracChangeset
for help on using the changeset viewer.