mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 09:18:54 +00:00
28 lines
1.1 KiB
PHP
28 lines
1.1 KiB
PHP
<?php
|
|
|
|
require(dirname(__FILE__)."/config.php");
|
|
require(WWW_DIR.'/lib/postprocess.php');
|
|
|
|
$postprocess = new PostProcess(true);
|
|
$postprocess->processSpotnab();
|
|
|
|
//get variables from config.sh and defaults.sh
|
|
$path = dirname(__FILE__);
|
|
$varnames = shell_exec("cat ".$path."/../config.sh | grep ^export | cut -d \= -f1 | awk '{print $2;}'");
|
|
$varnames .= shell_exec("cat ".$path."/../defaults.sh | grep ^export | cut -d \= -f1 | awk '{print $2;}'");
|
|
$vardata = shell_exec("cat ".$path."/../config.sh | grep ^export | cut -d \\\" -f2 | awk '{print $1;}'");
|
|
$vardata .= shell_exec("cat ".$path."/../defaults.sh | grep ^export | cut -d \\\" -f2 | awk '{print $1;}'");
|
|
$varnames = explode("\n", $varnames);
|
|
$vardata = explode("\n", $vardata);
|
|
$array = array_combine($varnames, $vardata);
|
|
unset($array['']);
|
|
|
|
if ( $array['SPOTNAB_ACTIVE'] == "true" ) {
|
|
$db = new DB();
|
|
@$query="UPDATE spotnabsources set active=1 where active=0";
|
|
@$result = $db->query($query);
|
|
printf("Don't refresh the spotnab sources page, it will reset the sources that were inactive back to inactive.");
|
|
}
|
|
?>
|
|
|