startRunning(); // Create a placeholder session so tmux commands do not throw server not found errors. exec('tmux new-session -ds placeholder 2>/dev/null'); //check if session exists $session = shell_exec("tmux list-session | grep $tmux_session"); // Kill the placeholder exec('tmux kill-session -t placeholder'); if ($session === null) { ColorCLI::doEcho(ColorCLI::info('Starting the tmux server and monitor script.'), true); passthru('php '.app()->/* @scrutinizer ignore-call */ path().'/../misc/update/tmux/run.php'); } } }