Пример #1
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");
}