Remove unused panes

This commit is contained in:
DariusIII
2025-04-17 16:59:32 +02:00
parent a3390262ae
commit 4c86fb56ef
2 changed files with 17 additions and 49 deletions
+17 -43
View File
@@ -67,9 +67,6 @@ class TmuxRun extends Tmux
case 'scraper':
$this->_runIRCScraper(3, $runVar);
break;
case 'updatetv':
$this->_runUpdateTv($runVar);
break;
}
break;
case 1:
@@ -101,9 +98,6 @@ class TmuxRun extends Tmux
case 'scraper':
$this->_runIRCScraper(3, $runVar);
break;
case 'updatetv':
$this->_runUpdateTv($runVar);
break;
}
break;
}
@@ -143,7 +137,7 @@ class TmuxRun extends Tmux
break;
default:
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:1.3 'echo \"\033[38;5;${color}m\n{$runVar['panes']['one'][3]} has been disabled/terminated by Decrypt Hashes\"'");
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:1.1 'echo \"\033[38;5;${color}m\n{$runVar['panes']['one'][1]} has been disabled/terminated by Decrypt Hashes\"'");
}
}
@@ -314,17 +308,17 @@ class TmuxRun extends Tmux
// run update_binaries
// $color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
if (((int) $runVar['settings']['binaries_run'] !== 0) && ($runVar['killswitch']['pp'] === false)) {
$log = $this->writelog($runVar['panes']['zero'][2]);
$log = $this->writelog($runVar['panes']['zero'][1]);
shell_exec(
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 ' \
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.1 ' \
{$runVar['scripts']['binaries']} $log; date +\"{$this->_dateFormat}\"; {$runVar['commands']['_sleep']} {$runVar['settings']['bins_timer']}' 2>&1 1> /dev/null"
);
} elseif ($runVar['killswitch']['pp'] === true) {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.2 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][2]} has been disabled/terminated by Exceeding Limits\"'");
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][1]} has been disabled/terminated by Exceeding Limits\"'");
} else {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.2 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][2]} has been disabled/terminated by Binaries\"'");
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][1]} has been disabled/terminated by Binaries\"'");
}
}
@@ -341,17 +335,17 @@ class TmuxRun extends Tmux
);
if (((int) $runVar['settings']['backfill'] !== 0) && ($runVar['killswitch']['coll'] === false) && ($runVar['killswitch']['pp'] === false)) {
$log = $this->writelog($runVar['panes']['zero'][3]);
$log = $this->writelog($runVar['panes']['zero'][2]);
shell_exec(
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.3 ' \
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 ' \
{$runVar['scripts']['backfill']} $log; date +\"{$this->_dateFormat}\"; {$runVar['commands']['_sleep']} $backsleep' 2>&1 1> /dev/null"
);
} elseif (($runVar['killswitch']['coll'] === true) || ($runVar['killswitch']['pp'] === true)) {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.3 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][3]} has been disabled/terminated by Exceeding Limits\"'");
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.2 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][2]} has been disabled/terminated by Exceeding Limits\"'");
} else {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.3 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][3]} has been disabled/terminated by Backfill\"'");
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.2 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][2]} has been disabled/terminated by Backfill\"'");
}
}
@@ -362,14 +356,14 @@ class TmuxRun extends Tmux
{
// run update_releases
if ((int) $runVar['settings']['releases_run'] !== 0) {
$log = $this->writelog($runVar['panes']['zero'][4]);
$log = $this->writelog($runVar['panes']['zero'][3]);
shell_exec(
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.4 ' \
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.3 ' \
{$runVar['scripts']['releases']} $log; date +\"{$this->_dateFormat}\"; {$runVar['commands']['_sleep']} {$runVar['settings']['rel_timer']}' 2>&1 1> /dev/null"
);
} else {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.4 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][4]} has been disabled/terminated by Releases\"'");
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.3 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][3]} has been disabled/terminated by Releases\"'");
}
}
@@ -482,26 +476,6 @@ class TmuxRun extends Tmux
}
}
/**
* @throws \Exception
*/
protected function _runUpdateTv(&$runVar): void
{
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:1.2 \
'echo \"\033[38;5;{$color}m\n{$runVar['panes']['one'][2]} has been disabled/terminated by Update TV/Theater\"'");
}
/**
* @throws \Exception
*/
protected function _runUpdateTvFull(&$runVar): void
{
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:1.0 \
'echo \"\033[38;5;{$color}m\n{$runVar['panes']['one'][0]} has been disabled/terminated by Update TV/Theater\"'");
}
/**
* @throws \Exception
*/
@@ -517,7 +491,7 @@ class TmuxRun extends Tmux
*/
protected function _runMainBasic(&$runVar): void
{
$log = $this->writelog($runVar['panes']['zero'][2]);
$log = $this->writelog($runVar['panes']['zero'][1]);
if (($runVar['killswitch']['pp'] === false) && (time() - $runVar['timers']['timer5'] <= 4800)) {
$date = 'date +"%Y-%m-%d %T";';
$sleep = sprintf(
@@ -546,12 +520,12 @@ class TmuxRun extends Tmux
default => '',
};
shell_exec("tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 '$binaries $backfill $releases $date $sleep' 2>&1 1> /dev/null");
shell_exec("tmux respawnp -t{$runVar['constants']['tmux_session']}:0.1 '$binaries $backfill $releases $date $sleep' 2>&1 1> /dev/null");
} elseif (($runVar['killswitch']['pp'] === false) && (time() - $runVar['timers']['timer5'] >= 4800)) {
// run backfill all once and resets the timer
if ((int) $runVar['settings']['backfill'] !== 0) {
shell_exec(
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 ' \
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.1 ' \
{$runVar['commands']['_php']} {$runVar['paths']['misc']}update/multiprocessing/backfill.php $log; \
date +\"{$this->_dateFormat}\"; {$runVar['commands']['_sleep']} {$runVar['settings']['seq_timer']}' 2>&1 1> /dev/null"
);
@@ -562,14 +536,14 @@ class TmuxRun extends Tmux
} elseif (($runVar['killswitch']['pp'] === true) && (int) $runVar['settings']['releases_run'] !== 0) {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec(
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 'echo \"\033[38;5;{$color}m\"; \
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\"; \
echo \"\nbinaries and backfill has been disabled/terminated by Exceeding Limits\"; \
{$runVar['scripts']['releases']} $log; date +\"{$this->_dateFormat}\"; echo \"\nbinaries and backfill has been disabled/terminated by Exceeding Limits\"; \
{$runVar['commands']['_sleep']} {$runVar['settings']['seq_timer']}' 2>&1 1> /dev/null"
);
} elseif ($runVar['killswitch']['pp'] === true) {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][2]} has been disabled/terminated by Exceeding Limits\"'");
shell_exec("tmux respawnp -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][1]} has been disabled/terminated by Exceeding Limits\"'");
}
}
-6
View File
@@ -97,14 +97,11 @@ function start_apps($tmux_session): void
function window_utilities($tmux_session)
{
Process::run("tmux new-window -t $tmux_session -n utils 'printf \"\033]2;fixReleaseNames\033\"'");
Process::run("tmux splitw -t $tmux_session:1 -v -l 50% 'printf \"\033]2;updateTVandTheaters\033\"'");
Process::run("tmux selectp -t $tmux_session:1.0; tmux splitw -t $tmux_session:1 -h -l 50% 'printf \"\033]2;removeCrapReleases\033\"'");
Process::run("tmux selectp -t $tmux_session:1.2; tmux splitw -t $tmux_session:1 -h -l 50% 'printf \"\033]2;decryptHashes\033\"'");
}
function window_stripped_utilities($tmux_session)
{
Process::run("tmux new-window -t $tmux_session -n utils 'printf \"\033]2;updateTVandTheaters\033\"'");
Process::run("tmux selectp -t $tmux_session:1.0; tmux splitw -t $tmux_session:1 -h -l 50% 'printf \"\033]2;postprocessing_amazon\033\"'");
}
@@ -133,20 +130,17 @@ $tmuxConfig = $tmuxPath.'tmux.conf';
if ((int) $seq === 1) {
Process::run("cd {$tmuxPath}; tmux -f $tmuxConfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;\"Monitor\"\033\"'");
Process::run("tmux selectp -t $tmux_session:0.0; tmux splitw -t $tmux_session:0 -h -l 67% 'printf \"\033]2;update_releases\033\"'");
Process::run("tmux selectp -t $tmux_session:0.0; tmux splitw -t $tmux_session:0 -v -l 25% 'printf \"\033]2;nzb-import\033\"'");
window_utilities($tmux_session);
window_post($tmux_session);
} elseif ((int) $seq === 2) {
Process::run("cd {$tmuxPath}; tmux -f $tmuxConfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;\"Monitor\"\033\"'");
Process::run("tmux selectp -t $tmux_session:0.0; tmux splitw -t $tmux_session:0 -h -l 67% 'printf \"\033]2;sequential\033\"'");
Process::run("tmux selectp -t $tmux_session:0.0; tmux splitw -t $tmux_session:0 -v -l 25% 'printf \"\033]2;nzb-import\033\"'");
window_stripped_utilities($tmux_session);
} else {
Process::run("cd {$tmuxPath}; tmux -f $tmuxConfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;Monitor\033\"'");
Process::run("tmux selectp -t $tmux_session:0.0; tmux splitw -t $tmux_session:0 -h -l 67% 'printf \"\033]2;update_binaries\033\"'");
Process::run("tmux selectp -t $tmux_session:0.0; tmux splitw -t $tmux_session:0 -v -l 25% 'printf \"\033]2;nzb-import\033\"'");
Process::run("tmux selectp -t $tmux_session:0.2; tmux splitw -t $tmux_session:0 -v -l 67% 'printf \"\033]2;backfill\033\"'");
Process::run("tmux splitw -t $tmux_session -v -l 50% 'printf \"\033]2;update_releases\033\"'");