예제 #1
0
function build(){
$users=new usersMenus();	
$pidfile="/etc/artica-postfix/pids/".basename(__FILE__).".pid";
$oldpid=@file_get_contents($pidfile);
$unix=new unix();
if($unix->process_exists($oldpid)){
	echo "Starting......: Building networks already executed PID: $oldpid\n";
	die();
}
@file_put_contents($pidfile,getmypid());

	if($users->AS_DEBIAN_FAMILY){
		BuildNetWorksDebian();
		return;
	}
	
	BuildNetWorksRedhat();
	bridges_build();
	Checkipv6();
	
	
}
예제 #2
0
function bridge_delete($ID)
{
    $q = new mysql();
    $nicbr = "br{$ID}";
    $NetBuilder = new system_nic();
    $NetBuilder->LoadTools();
    $NICS = $NetBuilder->BuildBridges_getlinked();
    while (list($a, $b) = each($NICS)) {
        $q->QUERY_SQL("UPDATE `nics` SET Bridged=0, BridgedTo='' WHERE Interface='{$b}'", "artica_backup");
        $GLOBALS["SCRIPTS_DEL"][] = "{$GLOBALS["brctlbin"]} delif {$nicbr} {$b}";
        $GLOBALS["SCRIPTS_DEL"][] = "{$GLOBALS["ifconfig"]} {$b} down";
    }
    $GLOBALS["SCRIPTS_DEL"][] = "{$GLOBALS["ifconfig"]} {$nicbr} down";
    $GLOBALS["SCRIPTS_DEL"][] = "{$GLOBALS["brctlbin"]} delbr {$nicbr}";
    $q->QUERY_SQL("DELETE FROM `nics_bridge` WHERE ID='{$ID}'", "artica_backup");
    while (list($id, $ligne) = each($GLOBALS["SCRIPTS_DEL"])) {
        echo "Starting......: " . date("H:i:s") . " `{$ligne}`\n";
        shell_exec("{$ligne}");
    }
    bridge_deletemanu($nicbr);
    BuildNetWorksDebian();
    shell_exec("/etc/init.d/artica-ifup start");
}