diff --git a/bin/monitor.php b/bin/monitor.php index 6deac74ea..4fc9072d0 100644 --- a/bin/monitor.php +++ b/bin/monitor.php @@ -2,7 +2,7 @@ require(dirname(__FILE__)."/config.php"); require(WWW_DIR.'/lib/postprocess.php'); -$version="0.1r729"; +$version="0.1r730"; $db = new DB(); diff --git a/bin/processSpotnab.php b/bin/processSpotnab.php index 60ce91a6a..a6ac21d77 100644 --- a/bin/processSpotnab.php +++ b/bin/processSpotnab.php @@ -6,5 +6,22 @@ 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."); +} ?> diff --git a/config.sh b/config.sh index 3dd71c889..a5775fcc3 100644 --- a/config.sh +++ b/config.sh @@ -295,6 +295,9 @@ export SPOTNAB="false" #How often to update the PreDB in seconds export SPOTNAB_TIMER="900" +#automatically set ALL sources to active after retrieving sources +export SPOTNAB_ACTIVE="false" + ############################################################ #update the tv schedule and in theaters listings