Ignore:
Timestamp:
Nov 3, 2008, 7:48:12 PM (16 years ago)
Author:
george
Message:
  • Upraveno: GenerovacĂ­ skripty.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • system/generators/dhcp_routerboard.php

    r103 r111  
    2424$Commands = array();
    2525//$MaxSubnet = 1;
    26 for($i = 1; $i <= 4; $i++)
     26$Commands[] = '/ip dhcp-server lease { remove [find]}';
     27for($i = 0; $i <= 5; $i++)
    2728{
    2829/*
     
    3536  while($Row = $DbResult->fetch_array())
    3637  {
    37     $Data = $Row['name'];
    38     if(strlen($Data) < 9) $Data .= "\t";
     38//    $Data = $Row['name'];
     39//    if(strlen($Data) < 9) $Data .= "\t";
    3940//    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'].']';
    4141    $Commands[] = '/ip dhcp-server lease add mac-address='.$Row['MAC'].' address='.$Row['IP'].' server=dhcp'.$i.' comment='.$Row['name'];
    4242  }
     
    4646//fclose($File);
    4747$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.'"';
    4949echo($Command);
    5050exec($Command, $Output);
Note: See TracChangeset for help on using the changeset viewer.