mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-02 19:28:55 +00:00
Move more scripts out of tmux folder, move tmux.conf out of conf folder.
(cherry picked from commit 2e54188)
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once(dirname(__FILE__) . "/config.php");
|
||||
|
||||
|
||||
$time = TIME();
|
||||
$c = new ColorCLI();
|
||||
|
||||
if (isset($argv[1])) {
|
||||
$group = $argv[1];
|
||||
echo $c->header("Updating group {$group}");
|
||||
|
||||
$g = new Groups;
|
||||
$group = $g->getByName($group);
|
||||
|
||||
$bin = new Binaries;
|
||||
$bin->updateGroup($group);
|
||||
} else {
|
||||
$binaries = new Binaries;
|
||||
$binaries->updateAllGroups();
|
||||
}
|
||||
|
||||
function relativeTime($_time)
|
||||
{
|
||||
$d = [];
|
||||
$d[0] = array(1, "sec");
|
||||
$d[1] = array(60, "min");
|
||||
$d[2] = array(3600, "hr");
|
||||
$d[3] = array(86400, "day");
|
||||
$d[4] = array(31104000, "yr");
|
||||
|
||||
$w = [];
|
||||
|
||||
$return = "";
|
||||
$now = TIME();
|
||||
$diff = ($now - $_time);
|
||||
$secondsLeft = $diff;
|
||||
|
||||
for ($i = 4; $i > -1; $i--) {
|
||||
$w[$i] = intval($secondsLeft / $d[$i][0]);
|
||||
$secondsLeft -= ($w[$i] * $d[$i][0]);
|
||||
if ($w[$i] != 0) {
|
||||
//$return.= abs($w[$i]). " " . $d[$i][1] . (($w[$i]>1)?'s':'') ." ";
|
||||
$return .= $w[$i] . " " . $d[$i][1] . (($w[$i] > 1) ? 's' : '') . " ";
|
||||
}
|
||||
}
|
||||
|
||||
//$return .= ($diff>0)?"ago":"left";
|
||||
return $return;
|
||||
}
|
||||
|
||||
echo $c->header("Group update process completed in: " . relativeTime($time) . "\n");
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
tmux_user.conf
|
||||
my.cnf
|
||||
@@ -84,7 +84,7 @@ while ($runVar['counts']['iterations'] > 0) {
|
||||
|
||||
//assign scripts
|
||||
$runVar['scripts']['releases'] = ($runVar['constants']['tablepergroup'] == 0
|
||||
? "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/tmux/bin/update_releases.php 1 false"
|
||||
? "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/update_releases.php 1 false"
|
||||
: "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/releases.php"
|
||||
);
|
||||
|
||||
@@ -104,7 +104,7 @@ while ($runVar['counts']['iterations'] > 0) {
|
||||
$runVar['scripts']['backfill'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/backfill.php";
|
||||
break;
|
||||
case 2:
|
||||
$runVar['scripts']['backfill'] = "{$runVar['commands']['_python']} {$runVar['paths']['misc']}update_scripts/nix_scripts/tmux/python/backfill_threaded.py group";
|
||||
$runVar['scripts']['backfill'] = "{$runVar['commands']['_python']} {$runVar['paths']['misc']}update_scripts/python/backfill_threaded.py group";
|
||||
break;
|
||||
case 4:
|
||||
$runVar['scripts']['backfill'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/safe.php backfill";
|
||||
|
||||
@@ -153,9 +153,9 @@ function window_proxy($tmux_session, $window)
|
||||
$nntpproxy = $pdo->getSetting('nntpproxy');
|
||||
if ($nntpproxy === '1') {
|
||||
$DIR = NN_MISC;
|
||||
$nntpproxypy = $DIR . "update_scripts/nix_scripts/tmux/python/nntpproxy.py";
|
||||
if (file_exists($DIR . "update_scripts/nix_scripts/tmux/python/lib/nntpproxy.conf")) {
|
||||
$nntpproxyconf = $DIR . "update_scripts/nix_scripts/tmux/python/lib/nntpproxy.conf";
|
||||
$nntpproxypy = $DIR . "update_scripts/python/nntpproxy.py";
|
||||
if (file_exists($DIR . "update_scripts/python/lib/nntpproxy.conf")) {
|
||||
$nntpproxyconf = $DIR . "update_scripts/python/lib/nntpproxy.conf";
|
||||
exec("tmux new-window -t $tmux_session -n nntpproxy 'printf \"\033]2;NNTPProxy\033\" && python $nntpproxypy $nntpproxyconf'");
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ function attach($DIR, $tmux_session)
|
||||
if ($powerline == 1) {
|
||||
$tmuxconfig = $DIR . "powerline/tmux.conf";
|
||||
} else {
|
||||
$tmuxconfig = $DIR . "conf/tmux.conf";
|
||||
$tmuxconfig = $DIR . "tmux.conf";
|
||||
}
|
||||
|
||||
if ($seq == 1) {
|
||||
|
||||
Reference in New Issue
Block a user