Esempio n. 1
0
    exit;
}
if ($argv[1] == "--routes") {
    routes();
    exit;
}
if ($argv[1] == "--routes-del") {
    routes_del($argv[2]);
    exit;
}
if ($argv[1] == "--vlans") {
    build();
    exit;
}
if ($argv[1] == "--postfix-instances") {
    postfix_multiples_instances();
    exit;
}
if ($argv[1] == "--ping") {
    ping($argv[2]);
    exit;
}
if ($argv[1] == "--ipv6") {
    Checkipv6();
    exit;
}
if ($argv[1] == "--ifupifdown") {
    ifupifdown($argv[2]);
    exit;
}
if ($argv[1] == "--reconstruct-interface") {
Esempio n. 2
0
include_once(dirname(__FILE__) . '/framework/class.unix.inc');
include_once(dirname(__FILE__) . '/framework/frame.class.inc');
include_once(dirname(__FILE__) . '/ressources/class.system.network.inc');
include_once(dirname(__FILE__) . '/ressources/class.system.nics.inc');

if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");}
if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["VERBOSE"]=true;ini_set_verbosed();}
if($argv[1]=="--interfaces"){interfaces_show();die();}
if($argv[1]=="--just-add"){routes();die();}
if($argv[1]=="--ifconfig"){ifconfig_tests();exit;}
if($argv[1]=="--bridges"){bridges_build();exit;}
if($argv[1]=="--parse-tests"){ifconfig_parse($argv[2]);exit;}
if($argv[1]=="--routes"){routes();exit;}
if($argv[1]=="--routes-del"){routes_del($argv[2]);exit;}
if($argv[1]=="--vlans"){build();exit;}
if($argv[1]=="--postfix-instances"){postfix_multiples_instances();exit;}
if($argv[1]=="--ping"){ping($argv[2]);exit;}
if($argv[1]=="--ipv6"){Checkipv6();exit;}




build();

//
//vconfig set_flag eth1.3 1 1
//vconfig set_flag eth1.4 1 1

//http://www.cyberciti.biz/tips/howto-configure-linux-virtual-local-area-network-vlan.html
//http://www.stg.net/vlanbridge