Changeset 111 for system/generators/dhcp_routerboard.php
- Timestamp:
- Nov 3, 2008, 7:48:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
system/generators/dhcp_routerboard.php
r103 r111 24 24 $Commands = array(); 25 25 //$MaxSubnet = 1; 26 for($i = 1; $i <= 4; $i++) 26 $Commands[] = '/ip dhcp-server lease { remove [find]}'; 27 for($i = 0; $i <= 5; $i++) 27 28 { 28 29 /* … … 35 36 while($Row = $DbResult->fetch_array()) 36 37 { 37 $Data = $Row['name'];38 if(strlen($Data) < 9) $Data .= "\t";38 // $Data = $Row['name']; 39 // if(strlen($Data) < 9) $Data .= "\t"; 39 40 // fputs($File, " host ".$Data."\t{ fixed-address ".$Row['IP'].";\thardware ethernet ".$Row['MAC']."; }\n"); 40 $Commands[] = '/ip dhcp-server lease remove [/ip dhcp-server lease find mac-address='.$Row['MAC'].']';41 41 $Commands[] = '/ip dhcp-server lease add mac-address='.$Row['MAC'].' address='.$Row['IP'].' server=dhcp'.$i.' comment='.$Row['name']; 42 42 } … … 46 46 //fclose($File); 47 47 $Commands = implode(';', $Commands); 48 $Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda- 5"'.$Commands.'"';48 $Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda-0 "'.$Commands.'"'; 49 49 echo($Command); 50 50 exec($Command, $Output);
Note:
See TracChangeset
for help on using the changeset viewer.