<?php require_once realpath(dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'indexer.php'); use nzedb\Tmux; use nzedb\db\Settings; use nzedb\utility\Misc; $pdo = new Settings(); $DIR = nZEDb_MISC; // Check that Db patch level is current. Also checks nZEDb.xml is valid. Misc::isPatched(); Misc::clearScreen(); $patch = $pdo->getSetting('sqlpatch'); $patch = $patch != '' ? $patch : 0; $delaytimet = $pdo->getSetting('delaytime'); $delaytimet = $delaytimet ? (int) $delaytimet : 2; $nntpproxy = $pdo->getSetting('nntpproxy'); echo "Starting Tmux...\n"; // Create a placeholder session so tmux commands do not throw server not found errors. exec('tmux new-session -ds placeholder 2>/dev/null'); // Search for NNTPProxy session that might be running from a user threaded.php run. Setup a clean environment to run in. exec("tmux list-session | grep NNTPProxy", $nntpkill); if (count($nntpkill) !== 0) { exec("tmux kill-session -t NNTPProxy"); echo $pdo->log->notice("Found NNTPProxy tmux session and killing it."); } else { exec("tmux list-session", $session); } $t = new Tmux(); $tmux = $t->get(); $tmux_session = isset($tmux->tmux_session) ? $tmux->tmux_session : 0; $seq = isset($tmux->sequential) ? $tmux->sequential : 0;