Project

General

Profile

Bug #641 ยป test.php

Perry Mason, 06/10/2010 08:36 AM

 
1
<?php
2
require_once("guiconfig.inc");
3
//require("interfaces.inc");
4
//require("util.inc");
5
//require("pfsense-utils.inc");
6
//require("system.inc");
7
//require("head.inc");
8
//require("fbegin.inc");
9
//require("functions.inc");
10
        global $g, $config;
11
// get system nic's and create a database for them
12
        $array_of_real_nic_names = array();
13
        $array_of_custom_nic_names = array();
14
        $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
15
		for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
16
			$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
17
		}
18
         		foreach ($ifdescrs as $ifdescr => $ifname):
19
/*			$ifinfo = get_interfaces_info($ifdescr);
20
*/
21
echo "$ifname ";
22
			$real_nic_names = convert_friendly_interface_to_real_interface_name($ifname);
23
			array_push($array_of_real_nic_names, $real_nic_names);
24
echo "$real_nic_names ";
25
		endforeach;
26
        // Get already nic's assigned to vnstat
27
        exec("ls /var/db/vnstat/ | grep -v '\.'", $vnstat_nic);
28
        // Compare real nic's with nic's assigned to vnstat
29
        $result = array_diff($array_of_real_nic_names, $vnstat_nic);
30
echo "$result";
31
//require("fend.inc");
32
?>
    (1-1/1)