Пример #1
0
function UpdateUtility()
{
    if ($GLOBALS["VERBOSE"]) {
        echo "Line: " . __LINE__ . ":: " . __FUNCTION__ . "\n";
    }
    $unix = new unix();
    $sock = new sockets();
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/" . basename(__FILE__) . ".pid";
    $pidtime = "/etc/artica-postfix/" . basename(__FILE__) . ".time";
    $pidtimeT = $unix->file_time_min($pidtime);
    if ($pidtimeT < 3) {
        if (!$GLOBALS["FORCE"]) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Line: " . __LINE__ . ":: last execution time {$pidtimeT} (require 3mn) or set --force " . __FUNCTION__ . "\n";
            }
            die;
        }
    }
    $pid = @file_get_contents($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $ProcessTime = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["VERBOSE"]) {
            echo "Line: " . __LINE__ . ":: Process {$pid}  already in memory since {$ProcessTime} minutes - " . __FUNCTION__ . "\n";
        }
        system_admin_events("Process {$pid}  already in memory since {$ProcessTime} minutes", "MAIN", __FILE__, __LINE__, "updateutility");
        die;
    }
    @unlink($pidtime);
    @file_put_contents($pidtime, time());
    @file_put_contents($pidfile, getmypid());
    $UpdateUtility_Console = $unix->find_program("UpdateUtility-Console");
    if (!is_file($UpdateUtility_Console)) {
        if ($GLOBALS["VERBOSE"]) {
            echo "Line: " . __LINE__ . ":: UpdateUtility-Console no such binary - " . __FUNCTION__ . "\n";
        }
        system_admin_events("UpdateUtility-Console no such binary", __FUNCTION__, __FILE__, __LINE__, "update");
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "Line: " . __LINE__ . ":: UpdateUtility_Console - {$UpdateUtility_Console}" . __FUNCTION__ . "\n";
    }
    @copy($UpdateUtility_Console, "/etc/UpdateUtility/UpdateUtility-Console");
    $UpdateUtilityAllProducts = $sock->GET_INFO("UpdateUtilityAllProducts");
    $UpdateUtilityOnlyForKav4Proxy = $sock->GET_INFO("UpdateUtilityOnlyForKav4Proxy");
    $UpdateUtilityUseLoop = $sock->GET_INFO("UpdateUtilityUseLoop");
    if (!is_numeric($UpdateUtilityAllProducts)) {
        $UpdateUtilityAllProducts = 1;
    }
    $UpdateUtilityStorePath = $sock->GET_INFO("UpdateUtilityStorePath");
    if ($UpdateUtilityStorePath == null) {
        $UpdateUtilityStorePath = "/home/kaspersky/UpdateUtility";
    }
    if (is_file("/opt/kaspersky/kav4proxy/sbin/kav4proxy-kavicapserver")) {
        if (!is_numeric($UpdateUtilityOnlyForKav4Proxy)) {
            $UpdateUtilityOnlyForKav4Proxy = 1;
        }
    }
    if ($UpdateUtilityUseLoop == 1) {
        $UpdateUtilityStorePath = "/automounts/UpdateUtility";
        $dev = $unix->MOUNTED_DIR($UpdateUtilityStorePath);
        if ($dev == null) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Line: " . __LINE__ . ":: {$UpdateUtilityStorePath} -> NOT MOUNTED " . __FUNCTION__ . "\n";
            }
            @file_put_contents("/var/log/artica-postfix/UpdateUtility-report-" . time() . ".log", "Report finished at " . date("Y-m-d H:i:s") . "\n{$UpdateUtilityStorePath} not mounted!\n");
            return;
        }
        if ($GLOBALS["VERBOSE"]) {
            echo "Line: " . __LINE__ . ":: {$UpdateUtilityStorePath} -> {$dev} OK" . __FUNCTION__ . "\n";
        }
    }
    @mkdir("{$UpdateUtilityStorePath}/databases/Updates", 0755, true);
    if (!is_dir($UpdateUtilityStorePath)) {
        @file_put_contents("/var/log/artica-postfix/UpdateUtility-report-" . time() . ".log", "Report finished at " . date("Y-m-d H:i:s") . "\n{$UpdateUtilityStorePath}/databases/Updates permission denied!\n");
        return;
    }
    $updateutility = new updateutilityv2();
    if ($UpdateUtilityAllProducts == 1) {
        system_admin_events("All products as been set...", __FUNCTION__, __FILE__, __LINE__, "update");
        while (list($key, $line) = each($updateutility->ALL_PKEYS)) {
            $updateutility->MAIN_ARRAY["ComponentSettings"][$key] = "true";
        }
        if (!isset($updateutility->MAIN_ARRAY["ComponentSettings"]["DownloadAllDatabases"])) {
            $updateutility->MAIN_ARRAY["ComponentSettings"]["DownloadAllDatabases"] = "true";
        }
        if (!isset($updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAdministrationKit_8_0_2048_2090"])) {
            $updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAdministrationKit_8_0_2048_2090"] = "true";
        }
        if (!isset($updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskySecurityCenter_9"])) {
            $updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskySecurityCenter_9"] = "true";
        }
    }
    if ($UpdateUtilityOnlyForKav4Proxy == 1) {
        system_admin_events("Kav4Proxy as been set...", __FUNCTION__, __FILE__, __LINE__, "update");
        reset($updateutility->ALL_PKEYS);
        while (list($key, $line) = each($updateutility->ALL_PKEYS)) {
            $updateutility->MAIN_ARRAY["ComponentSettings"][$key] = "false";
        }
        $updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5"] = "true";
        $updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5_41_51"] = "true";
        $updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5_62"] = "true";
        $updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5_62"] = "true";
        $updateutility->MAIN_ARRAY["ComponentSettings"]["DownloadAllDatabases"] = "false";
    }
    $updateutility->MAIN_ARRAY["ShedulerSettings"]["LastUpdate"] = '@Variant(\\0\\0\\0\\x10\\0\\0\\0\\0\\xff\\xff\\xff\\xff\\xff)';
    $updateutility->MAIN_ARRAY["ShedulerSettings"]["Time"] = '@Variant(\\0\\0\\0\\xf\\0\\0\\0\\0)';
    $t = time();
    $ini = new Bs_IniHandler();
    $ini2 = new Bs_IniHandler();
    $ini->_params = $updateutility->MAIN_ARRAY;
    $ini->_params["DirectoriesSettings"]["UpdatesFolder"] = "{$UpdateUtilityStorePath}/databases";
    $ini->_params["DirectoriesSettings"]["TempFolder"] = "{$UpdateUtilityStorePath}/TempFolder";
    @mkdir("{$UpdateUtilityStorePath}/databases", 0755, true);
    @mkdir("{$UpdateUtilityStorePath}/TempFolder", 0755, true);
    $report_file = "/var/log/artica-postfix/UpdateUtility-report-" . time() . ".log";
    $ini->_params["ConnectionSettings"]["UseSpecifiedProxyServerSettings"] = "false";
    $ini->_params["ConnectionSettings"]["UseAuthenticationProxyServer"] = "false";
    $ini->_params["ReportSettings"]["ReportFileName"] = "{$report_file}";
    $datas = $sock->GET_INFO("ArticaProxySettings");
    if (trim($datas) != null) {
        $ini2->loadString($datas);
        $ArticaProxyServerEnabled = $ini->_params["PROXY"]["ArticaProxyServerEnabled"];
        $ArticaProxyServerName = $ini->_params["PROXY"]["ArticaProxyServerName"];
        $ArticaProxyServerPort = $ini->_params["PROXY"]["ArticaProxyServerPort"];
        $ArticaProxyServerUsername = trim($ini->_params["PROXY"]["ArticaProxyServerUsername"]);
        $ArticaProxyServerUserPassword = $ini->_params["PROXY"]["ArticaProxyServerUserPassword"];
        if ($ArticaProxyServerEnabled == "yes") {
            $ini->_params["ConnectionSettings"]["UseSpecifiedProxyServerSettings"] = "true";
            $ini->_params["ConnectionSettings"]["AddressProxyServer"] = $ArticaProxyServerName;
            $ini->_params["ConnectionSettings"]["PortProxyServer"] = $ArticaProxyServerPort;
            if ($ArticaProxyServerUsername != null) {
                $ini->_params["ConnectionSettings"]["UseAuthenticationProxyServer"] = "true";
                $ini->_params["ConnectionSettings"]["UserNameProxyServer"] = "{$ArticaProxyServerUsername}";
                $ini->_params["ConnectionSettings"]["PasswordProxyServer"] = "{$ArticaProxyServerUserPassword}";
            }
        }
    }
    $ini->saveFile("/etc/UpdateUtility/updater.ini");
    chdir("/etc/UpdateUtility");
    @chmod("/etc/UpdateUtility/UpdateUtility-Console", 0755);
    $cmd = "./UpdateUtility-Console -u -o /etc/UpdateUtility/updater.ini -r 2>&1";
    $Restart1 = false;
    writelogs("Running `{$cmd}`", __FUNCTION__, __FILE__, __LINE__);
    exec("{$cmd}", $results);
    while (list($key, $line) = each($results)) {
        if (preg_match("#Total downloading:\\s+([0-9]+)", $line, $re)) {
            $PERCT = $re[1];
        }
        if (preg_match("#Segmentation fault#", $line)) {
            $text = @implode("\n", $results);
            $Restart1 = true;
            system_admin_events("Segmentation fault at {$PERCT}% on UpdateUtility restart again...\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
            $results = array();
            break;
        }
        writelogs("{$line}", __FUNCTION__, __FILE__, __LINE__);
    }
    if ($Restart1) {
        exec("{$cmd}", $results);
        while (list($key, $line) = each($results)) {
            if (preg_match("#Total downloading:\\s+([0-9]+)#", $line, $re)) {
                $PERCT = $re[1];
            }
            if (preg_match("#Segmentation fault#", $line)) {
                $text = @implode("\n", $results);
                system_admin_events("Segmentation fault at {$PERCT}%  on UpdateUtility Aborting...\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
            }
            writelogs("{$line}", __FUNCTION__, __FILE__, __LINE__);
        }
    }
    $t2 = time();
    $timehuman = $unix->distanceOfTimeInWords($t, $t2);
    $text = @implode("\n", $results);
    system_admin_events("Executing UpdateUtility Success took {$timehuman}\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
    $nohup = $unix->find_program("nohup");
    $php = $unix->LOCATE_PHP5_BIN();
    shell_exec("{$nohup} {$php} " . dirname(__FILE__) . "/exec.freeweb.php --reconfigure-updateutility >/dev/null 2>&1 &");
    ScanUpdateUtilityLogs(true);
    UpdateUtilitySize(true);
}
Пример #2
0
function UpdateUtility()
{
    if ($GLOBALS["VERBOSE"]) {
        echo "Line: " . __LINE__ . ":: " . __FUNCTION__ . "\n";
    }
    $unix = new unix();
    $sock = new sockets();
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/" . basename(__FILE__) . ".pid";
    $pidtime = "/etc/artica-postfix/" . basename(__FILE__) . ".time";
    $pidtimeT = $unix->file_time_min($pidtime);
    if ($pidtimeT < 3) {
        if (!$GLOBALS["FORCE"]) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Line: " . __LINE__ . ":: last execution time {$pidtimeT} (require 3mn) or set --force " . __FUNCTION__ . "\n";
            }
            die;
        }
    }
    $pid = @file_get_contents($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $ProcessTime = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["VERBOSE"]) {
            echo "Line: " . __LINE__ . ":: Process {$pid}  already in memory since {$ProcessTime} minutes - " . __FUNCTION__ . "\n";
        }
        system_admin_mysql(1, "Process {$pid}  already in memory since {$ProcessTime} minutes", __FILE__, __LINE__, "updateutility");
        die;
    }
    @unlink($pidtime);
    @file_put_contents($pidtime, time());
    @file_put_contents($pidfile, getmypid());
    $pid = $unix->PIDOF_PATTERN("UpdateUtility-Console");
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $ProcessTime = $unix->PROCCESS_TIME_MIN($pid);
        system_admin_mysql(1, "Process {$pid}  already in memory since {$ProcessTime} minutes", __FILE__, __LINE__, "updateutility");
        die;
    }
    $UpdateUtility_Console = "/etc/UpdateUtility/UpdateUtility-Console";
    if (!is_file($UpdateUtility_Console)) {
        if ($GLOBALS["VERBOSE"]) {
            echo "Line: " . __LINE__ . ":: UpdateUtility-Console no such binary - " . __FUNCTION__ . "\n";
        }
        system_admin_mysql(0, "UpdateUtility-Console no such binary", __FILE__, __LINE__, "update");
        return;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "Line: " . __LINE__ . ":: UpdateUtility_Console - {$UpdateUtility_Console}" . __FUNCTION__ . "\n";
    }
    $UpdateUtilityAllProducts = $sock->GET_INFO("UpdateUtilityAllProducts");
    $UpdateUtilityOnlyForKav4Proxy = $sock->GET_INFO("UpdateUtilityOnlyForKav4Proxy");
    $UpdateUtilityUseLoop = $sock->GET_INFO("UpdateUtilityUseLoop");
    if (!is_numeric($UpdateUtilityAllProducts)) {
        $UpdateUtilityAllProducts = 1;
    }
    $UpdateUtilityStorePath = $sock->GET_INFO("UpdateUtilityStorePath");
    if ($UpdateUtilityStorePath == null) {
        $UpdateUtilityStorePath = "/home/kaspersky/UpdateUtility";
    }
    $UpdateUtilityUpdatesType = intval($sock->GET_INFO("UpdateUtilityUpdatesType"));
    if (is_file("/opt/kaspersky/kav4proxy/sbin/kav4proxy-kavicapserver")) {
        if (!is_numeric($UpdateUtilityOnlyForKav4Proxy)) {
            $UpdateUtilityOnlyForKav4Proxy = 1;
        }
    }
    if ($UpdateUtilityUseLoop == 1) {
        $UpdateUtilityStorePath = "/automounts/UpdateUtility";
        $dev = $unix->MOUNTED_DIR($UpdateUtilityStorePath);
        if ($dev == null) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Line: " . __LINE__ . ":: {$UpdateUtilityStorePath} -> NOT MOUNTED " . __FUNCTION__ . "\n";
            }
            @file_put_contents("/var/log/artica-postfix/UpdateUtility-report-" . time() . ".log", "Report finished at " . date("Y-m-d H:i:s") . "\n{$UpdateUtilityStorePath} not mounted!\n");
            return;
        }
        if ($GLOBALS["VERBOSE"]) {
            echo "Line: " . __LINE__ . ":: {$UpdateUtilityStorePath} -> {$dev} OK" . __FUNCTION__ . "\n";
        }
    }
    @mkdir("{$UpdateUtilityStorePath}/databases/Updates", 0755, true);
    if (!is_dir($UpdateUtilityStorePath)) {
        @file_put_contents("/var/log/artica-postfix/UpdateUtility-report-" . time() . ".log", "Report finished at " . date("Y-m-d H:i:s") . "\n{$UpdateUtilityStorePath}/databases/Updates permission denied!\n");
        return;
    }
    $f[] = "[ConnectionSettings]";
    $f[] = "TimeoutConnection=60";
    $f[] = "UsePassiveFtpMode=true";
    $datas = $sock->GET_INFO("ArticaProxySettings");
    if (trim($datas) != null) {
        $ini2 = new Bs_IniHandler();
        $ini2->loadString($datas);
        $ArticaProxyServerEnabled = $ini->_params["PROXY"]["ArticaProxyServerEnabled"];
        $ArticaProxyServerName = $ini->_params["PROXY"]["ArticaProxyServerName"];
        $ArticaProxyServerPort = $ini->_params["PROXY"]["ArticaProxyServerPort"];
        $ArticaProxyServerUsername = trim($ini->_params["PROXY"]["ArticaProxyServerUsername"]);
        $ArticaProxyServerUserPassword = $ini->_params["PROXY"]["ArticaProxyServerUserPassword"];
        if (is_numeric($ArticaProxyServerEnabled)) {
            if ($ArticaProxyServerEnabled == 1) {
                $ArticaProxyServerEnabled = "yes";
            }
        }
        if ($ArticaProxyServerEnabled == "yes") {
            $f[] = "UseProxyServer=true";
            $f[] = "ByPassProxyServer=false";
            $f[] = "AddressProxyServer={$ArticaProxyServerName}";
            $f[] = "PortProxyServer={$ArticaProxyServerPort}";
            if ($ArticaProxyServerUsername != null) {
                $f[] = "UseAuthenticationProxyServer=true";
                $f[] = "UserNameProxyServer={$ArticaProxyServerUsername}";
                $f[] = "PasswordProxyServer={$ArticaProxyServerUserPassword}";
            }
        } else {
            $f[] = "UseProxyServer=false";
            $f[] = "ByPassProxyServer=true";
        }
    }
    @mkdir("{$UpdateUtilityStorePath}/databases", 0755, true);
    @mkdir("{$UpdateUtilityStorePath}/TempFolder", 0755, true);
    $t = time();
    $report_file = "/var/log/artica-postfix/UpdateUtility-report-" . time() . ".log";
    $f[] = "AutomaticallyDetectProxyServerSettings=true";
    $f[] = "UseSpecifiedProxyServerSettings=false";
    $f[] = "DownloadPatches=true";
    $f[] = "";
    $f[] = "[AdditionalSettings]";
    $f[] = "CreateCrashDumpFile=false";
    $f[] = "TurnTrace=false";
    $f[] = "AddIconToTray=false";
    $f[] = "MinimizeProgramUponTermination=true";
    $f[] = "AnimateIcon=true";
    $f[] = "ReturnCodeDesc=";
    $f[] = "";
    $f[] = "[ReportSettings]";
    $f[] = "DisplayReportsOnScreen=false";
    $f[] = "SaveReportsToFile=true";
    $f[] = "AppendToPreviousFile=false";
    $f[] = "SizeLogFileValue=1048576";
    $f[] = "ReportFileName={$report_file}";
    $f[] = "DeleteIfSize=true";
    $f[] = "DeleteIfNumDay=false";
    $f[] = "NoChangeLogFile=false";
    $f[] = "NumDayLifeLOgFileValue=7";
    $f[] = "";
    $f[] = "[DirectoriesSettings]";
    $f[] = "MoveToCurrentFolder=false";
    $f[] = "MoveToCustomFolder=true";
    $f[] = "UpdatesFolder={$UpdateUtilityStorePath}/database";
    $f[] = "TempFolder={$UpdateUtilityStorePath}/TempFolder";
    $f[] = "ClearTempFolder=true";
    $f[] = "";
    $f[] = "[UpdatesSourceSettings]";
    $f[] = "SourceCustomPath=";
    $f[] = "SourceCustom=false";
    $f[] = "SourceKlabServer=true";
    $f[] = "";
    $f[] = "[DownloadingSettings]";
    $f[] = "DownloadDataBasesAndModules=true";
    $f[] = "";
    if ($UpdateUtilityUpdatesType == 0) {
        $f[] = UpdateUtility_security_center();
    }
    if ($UpdateUtilityUpdatesType == 1) {
        $f[] = UpdateUtility_systems();
    }
    if ($UpdateUtilityUpdatesType == 2) {
        $f[] = UpdateUtility_servers();
    }
    if ($UpdateUtilityUpdatesType == 3) {
        $f[] = UpdateUtility_gateways();
    }
    if ($UpdateUtilityUpdatesType == 4) {
        $f[] = UpdateUtility_alls();
    }
    $f[] = "";
    $f[] = "[ShedulerSettings]";
    $f[] = "LastUpdate=@Variant(ÿÿÿÿÿ)";
    $f[] = "ShedulerType=0";
    $f[] = "PeriodValue=1";
    $f[] = "UseTime=true";
    $f[] = "Time=@Variant()";
    $f[] = "Monday=true";
    $f[] = "Tuesday=true";
    $f[] = "Wednesday=true";
    $f[] = "Thursday=true";
    $f[] = "Friday=true";
    $f[] = "Saturday=true";
    $f[] = "Sunday=true";
    $f[] = "";
    $f[] = "[SdkSettings]";
    $f[] = "PrimaryIndexFileName=u0607g.xml";
    $f[] = "PrimaryIndexRelativeUrlPath=index";
    $f[] = "LicensePath=";
    $f[] = "SimpleModeLicensing=true";
    $cgcreate = $unix->find_program("cgcreate");
    if (is_file($cgcreate)) {
        $UpdateUtilityCpuShares = intval($sock->GET_INFO("UpdateUtilityCpuShares"));
        $UpdateUtilityDiskIO = intval($sock->GET_INFO("UpdateUtilityDiskIO"));
        if ($UpdateUtilityCpuShares == 0) {
            $UpdateUtilityCpuShares = 256;
        }
        if ($UpdateUtilityDiskIO == 0) {
            $UpdateUtilityDiskIO = 450;
        }
        $unix->CGROUPS_limit_service_structure("kasupt", $UpdateUtilityCpuShares, 0, $UpdateUtilityDiskIO);
    }
    $UpdateUtilityPrefix = null;
    @file_put_contents("/etc/UpdateUtility/updater.ini", @implode("\n", $f));
    $f = array();
    $SH[] = "#!/bin/sh";
    $SH[] = "bindir=`dirname \"\$me\$0\"`";
    $SH[] = "libdir=`cd \"\${bindir}/lib\" ; pwd`";
    $SH[] = "LD_LIBRARY_PATH=\"\${libdir}:\${LD_LIBRARY_PATH}\"";
    $SH[] = "export LD_LIBRARY_PATH";
    $SH[] = "cd \${bindir}";
    if (is_file("/usr/bin/cgexec")) {
        $UpdateUtilityPrefix = "/usr/bin/cgexec -g cpu,cpuset,blkio:kasupt ";
    }
    $SH[] = "{$UpdateUtilityPrefix}./UpdateUtility-Console -u -o /etc/UpdateUtility/updater.ini -r 2>&1\$@";
    $SH[] = "";
    @file_put_contents("/etc/UpdateUtility/uu-console.sh", @implode("\n", $SH));
    $SH = array();
    chdir("/etc/UpdateUtility");
    @chmod("/etc/UpdateUtility/UpdateUtility-Console", 0755);
    @chmod("/etc/UpdateUtility/uu-console.sh", 0755);
    $cmd = "./uu-console.sh 2>&1";
    $Restart1 = false;
    writelogs("Running `{$cmd}`", __FUNCTION__, __FILE__, __LINE__);
    exec("{$cmd}", $results);
    while (list($key, $line) = each($results)) {
        if (preg_match("#Total downloading:\\s+([0-9]+)", $line, $re)) {
            $PERCT = $re[1];
        }
        if (preg_match("#Segmentation fault#", $line)) {
            $text = @implode("\n", $results);
            $Restart1 = true;
            system_admin_events("Segmentation fault at {$PERCT}% on UpdateUtility restart again...\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
            $results = array();
            break;
        }
        writelogs("{$line}", __FUNCTION__, __FILE__, __LINE__);
    }
    if ($Restart1) {
        exec("{$cmd}", $results);
        while (list($key, $line) = each($results)) {
            if (preg_match("#Total downloading:\\s+([0-9]+)#", $line, $re)) {
                $PERCT = $re[1];
            }
            if (preg_match("#Segmentation fault#", $line)) {
                $text = @implode("\n", $results);
                system_admin_events("Segmentation fault at {$PERCT}%  on UpdateUtility Aborting...\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
            }
            writelogs("{$line}", __FUNCTION__, __FILE__, __LINE__);
        }
    }
    $t2 = time();
    $timehuman = $unix->distanceOfTimeInWords($t, $t2);
    $text = @implode("\n", $results);
    system_admin_events("Executing UpdateUtility Success took {$timehuman}\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
    $nohup = $unix->find_program("nohup");
    $php = $unix->LOCATE_PHP5_BIN();
    shell_exec("{$nohup} {$php} " . dirname(__FILE__) . "/exec.freeweb.php --reconfigure-updateutility >/dev/null 2>&1 &");
    ScanUpdateUtilityLogs(true);
    UpdateUtilitySize(true);
}