Added testing function

This commit is contained in:
Riccardo Bicelli 2020-01-24 14:41:14 +01:00
parent 3447356cc8
commit 3e0a41e2d1
1 changed files with 32 additions and 0 deletions

View File

@ -24,6 +24,38 @@ require_once("service-utils.inc");
require_once('pkg-utils.inc');
//Testing function, for template creating purpose
function pfz_test(){
$ovpn_servers = pfz_openvpn_get_all_servers();
echo "OPENVPN Servers:\n";
print_r($ovpn_servers);
echo "-------------------\n";
$ovpn_clients = openvpn_get_active_clients();
echo "OPENVPN Servers:\n";
print_r($ovpn_clients);
echo "-------------------\n";
echo "Network Interfaces:\n";
$ifdescrs = get_configured_interface_with_descr(true);
$ifaces=array();
foreach ($ifdescrs as $ifdescr => $ifname){
$ifinfo = get_interface_info($ifdescr);
$ifaces[$ifname] = $ifinfo;
}
print_r($ifaces);
print_r(get_interface_arr());
print_r(get_configured_interface_list());
echo "Services: \n";
$services = get_services();
print_r($services);
}
function pfz_get_if_name($hwif){
$ifdescrs = get_configured_interface_with_descr(true);