Last change
on this file since 1 was 1, checked in by george, 17 years ago |
Prvotní import všeho
|
-
Property svn:executable
set to
*
|
File size:
887 bytes
|
Line | |
---|
1 | <?
|
---|
2 |
|
---|
3 | include_once('../html/is/db.php');
|
---|
4 | include_once('../html/is/error.php');
|
---|
5 | DB_Init('localhost','root','','is');
|
---|
6 |
|
---|
7 | echo("Checking hosts config...\n");
|
---|
8 | DB_Select('hosts','*',"block=0");
|
---|
9 | while($Host = DB_Row())
|
---|
10 | {
|
---|
11 | $Output = array();
|
---|
12 |
|
---|
13 | echo("\n".$Host['name'].' ');
|
---|
14 | exec('arping -c 1 '.$Host['IP'],$Output);
|
---|
15 | if(count($Output)!=4)
|
---|
16 | {
|
---|
17 | $Output = array();
|
---|
18 | exec('arping -I wlan0 -c 1 '.$Host['IP'],$Output);
|
---|
19 | if(count($Output)!=4)
|
---|
20 | {
|
---|
21 | $Output = array();
|
---|
22 | exec('arping -I wlan1 -c 1 '.$Host['IP'],$Output);
|
---|
23 | if(count($Output)!=4) continue;
|
---|
24 | else $Section = 2;
|
---|
25 | } else $Section = 1;
|
---|
26 | } else $Section = 0;
|
---|
27 | //print_r($Output);
|
---|
28 | $Output = explode(' ',$Output[1]);
|
---|
29 | $MAC = substr($Output[4],1,-1);
|
---|
30 | $IP = $Output[3];
|
---|
31 | echo($Host['MAC'].'-'.$MAC);
|
---|
32 | if($Host['MAC'] != $MAC) echo(' rozdil');
|
---|
33 | }
|
---|
34 | echo("\n");
|
---|
35 |
|
---|
36 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.