Changeset 171 for www/system/generators/nat_routerboard.php
- Timestamp:
- Mar 24, 2009, 7:28:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/system/generators/nat_routerboard.php
r161 r171 1 1 <?php 2 2 3 include_once('../../global.php'); 3 4 … … 8 9 $Commands[] = '/ip firewall nat { remove [find] }'; 9 10 10 $DbResult = $Database-> select('users', 'CONCAT(second_name, " ", first_name) as fullname, id');11 while($ User = $DbResult->fetch_array())11 $DbResult = $Database->query('SELECT Member.*, Subject.* FROM Member ON Member.Subject = Subject.Id'); 12 while($Member = $DbResult->fetch_assoc()) 12 13 { 13 echo($ User['fullname']."\n");14 $DbResult2 = $Database->select('hosts', '*', '(external_ip <> "") AND (user='.$ User['id'].') AND (IP != external_ip) ORDER BY id DESC');15 while($Host = $DbResult2->fetch_a rray())14 echo($Member['Name']."\n"); 15 $DbResult2 = $Database->select('hosts', '*', '(external_ip <> "") AND (user='.$Member['Id'].') AND (IP != external_ip) ORDER BY id DESC'); 16 while($Host = $DbResult2->fetch_assoc()) 16 17 { 17 18 echo($Host['name']."\n"); … … 28 29 29 30 $Commands = addslashes(implode(';', $Commands)); 30 $Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa '.$Router.' "'.$Commands.'"';31 //echo($Command."\n");32 exec($Command, $Output);31 $Command = '/usr/bin/ssh -l admin-ssh -i id_dsa '.$Router.' "'.$Commands.'"'; 32 echo($Command."\n"); 33 //exec($Command, $Output); 33 34 //array_pop($Output); 34 35 //print_r($Output);
Note:
See TracChangeset
for help on using the changeset viewer.