mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
284 lines
11 KiB
Bash
284 lines
11 KiB
Bash
#!/usr/bin/env bash
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
#Copy this file to defaults.sh
|
|
#DO NOT EDIT THIS FILE
|
|
|
|
#########################EDIT THESE#########################
|
|
############################################################
|
|
|
|
#This is the shutdown, true/false
|
|
#on, it runs, off and no scripts will be RESTARTED, when all panes are DEAD, killall tmux
|
|
#if this is set to false, the script will run 1 loop and terminate
|
|
export RUNNING="true"
|
|
|
|
############################################################
|
|
|
|
#Set paths
|
|
export NEWZPATH="/var/www/newznab"
|
|
|
|
#Should not need to change
|
|
export NEWZNAB_PATH=$NEWZPATH"/misc/update_scripts"
|
|
export TESTING_PATH=$NEWZPATH"/misc/testing"
|
|
export ADMIN_PATH=$NEWZPATH"/www/admin"
|
|
|
|
############################################################
|
|
|
|
#Post Processing Additional is the post processing that downloads rar files and attempts to get info for your site
|
|
#you are able to set the number of process to be run from 1-32, remember that each process uses 1 of your nntp connections
|
|
#so, if you have 20, and you set this to 32, you will have errors, lots of errors, nfo lookup uses 1 connection
|
|
#binaries and backfill threaded default to 10 connections each, so understand how many connections you are using when setting
|
|
#trial and error for this, 1 runs always, 2 if more than 200, 3 more than 300 and so on.
|
|
#At some point, increasing this begins to slow things down. It will need to be adjusted for your system
|
|
#to get the desired performance, 0 will disable all post processing
|
|
export POST_TO_RUN="1"
|
|
|
|
#Enter the session name to be used by tmux
|
|
export TMUX_SESSION="Newznab"
|
|
|
|
#Set, in seconds - how often the monitor.php (left top pane) script should update, 0 may cause errors
|
|
export MONITOR_UPDATE="30"
|
|
|
|
############################################################
|
|
|
|
#Choose to run update_binaries true/false
|
|
export BINARIES="false"
|
|
|
|
#Choose to run the threaded or non-threaded newznab binaries scripts true/false
|
|
#update_binaries.php or update_binaries_threaded.php
|
|
export BINARIES_THREADS="false"
|
|
|
|
#Set, in seconds - how long the update_binaries should sleep between runs, 0 may cause errors
|
|
#top right pane
|
|
export BINARIES_SLEEP="40"
|
|
|
|
#Set the max amount of unprocessed releases and still allow update_binaries to run
|
|
#set to 0 to disable
|
|
export MAX_RELEASES="0"
|
|
|
|
#Set the max amount of of rows in the parts table and still allow update_binaries to run
|
|
#set to 0 to disable
|
|
export BINARIES_MAX_ROWS="0"
|
|
|
|
############################################################
|
|
|
|
#Choose to run backfill script true/false
|
|
export BACKFILL="false"
|
|
|
|
#Choose to run the threaded or non-threaded newznab backfill scripts true/false
|
|
#backfill.php or backfill_threaded.php
|
|
export BACKFILL_THREADS="false"
|
|
|
|
#Set, in seconds - how long the backfill should sleep between runs, 0 may cause errors
|
|
#in pane below update_binaries
|
|
export BACKFILL_SLEEP="40"
|
|
|
|
#Set the max amount of unprocessed releases and still allow backfill to run
|
|
#set to 0 to disable
|
|
export BACKFILL_MAX_RELEASES="0"
|
|
|
|
#Set the max amount of of rows in the parts table and still allow backfill to run
|
|
#set to 0 to disable
|
|
export BACKFILL_MAX_ROWS="0"
|
|
|
|
#Set the maximum days to backfill, you set the nn+ admin/edit backfill to 1
|
|
#this will increment your database by 1 after each backfill loop
|
|
#once your backfill numbers reach $MAXDAYS, then it will no long increment the database
|
|
#backfill will continue to run, and do no work, at that point you should disable backfill, below
|
|
export MAXDAYS="210"
|
|
|
|
############################################################
|
|
|
|
#Set the path to the nzb dump you downloaded from torrents, this is the path to bulk files folder of nzbs
|
|
#this does not recurse through subfolders, unless you set NZB_THREADS to true
|
|
export NZBS="/path/to/nzbs"
|
|
|
|
#Choose to run import nzb script true/false
|
|
export IMPORT="false"
|
|
|
|
#If, you have all of your nzbs in one folder select false
|
|
#If, you have all of you nzbs split into separate in with the root at $NZBS then select true
|
|
#and 10 nzbs will be imported from each subfolder per loop.
|
|
#Importing this way, allows all postprocessing scripts to run, such as book, music, movies
|
|
#Instead of doing all 1 tye at once, spread the load
|
|
export NZB_THREADS="false"
|
|
|
|
#Set max number of folders to process per loop. This includes empty folders.
|
|
export NZB_FOLDER_COUNT="20"
|
|
|
|
#How many nzbs to import per loop, if using NZB_THREADS=true the per folder
|
|
export NZBCOUNT="10"
|
|
|
|
#Set, in seconds - how long the nzb-import should sleep between runs, 0 may cause errors
|
|
#below backfill
|
|
export IMPORT_SLEEP="40"
|
|
|
|
#Set the max amount of unprocessed releases and still allow nzb-import to run
|
|
#set to 0 to disable
|
|
export IMPORT_MAX_RELEASES="0"
|
|
|
|
#Set the max amount of of rows in the parts table and still allow nzb-import to run
|
|
#set to 0 to disable
|
|
export IMPORT_MAX_ROWS="0"
|
|
|
|
#import nzbs using the filename as the release name true/false
|
|
export IMPORT_TRUE="false"
|
|
|
|
############################################################
|
|
|
|
#Create releases, this is really only necessary to turn off when you only want to postprocess
|
|
export RELEASES="false"
|
|
|
|
#Set, in seconds - how long the update_release should sleep between runs, 0 may cause errors
|
|
#bottom right
|
|
export RELEASES_SLEEP="40"
|
|
|
|
############################################################
|
|
|
|
#Choose to run optimize_innodb.php or optimize_mysiam.php script true/false
|
|
#set to false by default, you should test the optimse scripts in bin first
|
|
#optimize_myisam on small tables runs after every 5th loop of update_releases
|
|
export OPTIMIZE="false"
|
|
|
|
#How often to run optimize_myisam on small tables seconds, default is 10 min
|
|
export MYISAM_SMALL="600"
|
|
|
|
#How often to run optimize_myisam on large tables seconds, default is 1 hr
|
|
export MYISAM_LARGE="3600"
|
|
|
|
#How often to run optimize_innodb on small tables in seconds, default is 2 hr
|
|
export INNODB_SMALL="7200"
|
|
|
|
#How often to run optimize_innodb on large tables in seconds, default is 48 hrs
|
|
export INNODB_LARGE="172800"
|
|
|
|
############################################################
|
|
|
|
#Choose your database engine, comment the one true/false
|
|
#you should have already converted your database to InnoDB engine, if you select true here
|
|
export INNODB="false"
|
|
|
|
############################################################
|
|
|
|
#Choose to run update_cleanup.php and removespecial.php true/false
|
|
#set to false by default, you will need to edit /misc/testing/update_cleanup.php and /misc/testing/update_parsing.php
|
|
#to actually do anything, directions are in the file
|
|
export CLEANUP="false"
|
|
|
|
#How oftern do you want update_cleanup.php and removespecial.php to run, in seconds
|
|
export CLEANUP_TIMER="3600"
|
|
|
|
############################################################
|
|
|
|
#Choose to run update_parsing.php true/false
|
|
#set to false by default, you will need to edit /misc/testing/update_parsing.php
|
|
#to actually do anything, directions are in the file
|
|
export PARSING="false"
|
|
|
|
#How oftern do you want update_parsing.php to run, in seconds
|
|
export PARSING_TIMER="3600"
|
|
|
|
############################################################
|
|
|
|
#How often to update the PreDB in seconds
|
|
export PREDB_TIMER="900"
|
|
|
|
#How often to update the TV Schedule and the In Theaters in seconds
|
|
export TVRAGE_TIMER="43200"
|
|
|
|
############################################################
|
|
|
|
#Choose to run sphinx.php script true/false
|
|
#set to false by default, you should test the script first, php sphinx.php from the bin folder
|
|
export SPHINX="false"
|
|
|
|
#How often to run sphinx in seconds
|
|
export SPHINX_TIMER="3600"
|
|
|
|
############################################################
|
|
|
|
#mediainfo and ffmpeg can hang occasionally, set timer, in minutes, to anything other than 0 to enable
|
|
export KILL_PROCESS="0"
|
|
|
|
############################################################
|
|
|
|
#Delete parts and binaries older than retention days, which is set in edit - site
|
|
#NOT IMPLEMENTED YET
|
|
export DELETE_PARTS="false"
|
|
|
|
############################################################
|
|
|
|
#Specify your SED binary
|
|
export SED="/bin/sed"
|
|
#export SED="/usr/local/bin/gsed"
|
|
|
|
############################################################
|
|
|
|
#Select some monitoring script, if they are not installed, it will not affect the running of the scripts
|
|
#these are set to false by default, enable if you want them
|
|
export USE_HTOP="false"
|
|
export USE_NMON="false"
|
|
export USE_BWMNG="false"
|
|
export USE_IOTOP="false"
|
|
export USE_MYTOP="false"
|
|
export USE_VNSTAT="false"
|
|
export USE_IFTOP="false"
|
|
|
|
############################################################
|
|
|
|
#Use powerline scripts to display the status bar
|
|
#To display properly, you need a modified font, download and install the font and then select that font in your terminal
|
|
#This is done on the terminal computer, not the newznab++ server
|
|
#download fonts from https://github.com/jonnyboy/powerline-fonts
|
|
#I recommend Consolas if you are using putty in Win7
|
|
export POWERLINE="false"
|
|
|
|
############################################################
|
|
|
|
#Use tmpfs to run postprocessing on true/false
|
|
export RAMDISK="false"
|
|
|
|
############################################################
|
|
|
|
#By using this script you understand that the programmer is not responsible for any loss of data, users, or sanity.
|
|
#You also agree that you were smart enough to make a backup of your database and files. Do you agree? yes/no
|
|
export AGREED="no"
|
|
|
|
############################################################
|
|
|
|
##END OF EDITS##
|
|
|
|
command -v mysql >/dev/null 2>&1 || { echo >&2 "I require mysql but it's not installed. Aborting."; exit 1; } && export MYSQL=`command -v mysql`
|
|
command -v php5 >/dev/null 2>&1 && export PHP=`command -v php5` || { export PHP=`command -v php`; }
|
|
command -v tmux >/dev/null 2>&1 || { echo >&2 "I require tmux but it's not installed. Aborting."; exit 1; } && export TMUXCMD=`command -v tmux`
|
|
command -v nice >/dev/null 2>&1 || { echo >&2 "I require nice but it's not installed. Aborting."; exit 1; } && export NICE=`command -v nice`
|
|
|
|
|
|
if [[ $USE_HTOP == "true" ]]; then
|
|
command -v htop >/dev/null 2>&1|| { echo >&2 "I require htop but it's not installed. Aborting."; exit 1; } && export HTOP=`command -v htop`
|
|
fi
|
|
if [[ $USE_NMON == "true" ]]; then
|
|
command -v nmon >/dev/null 2>&1 || { echo >&2 "I require nmon but it's not installed. Aborting."; exit 1; } && export NMON=`command -v nmon`
|
|
fi
|
|
if [[ $USE_BWMNG == "true" ]]; then
|
|
command -v bwm-ng >/dev/null 2>&1|| { echo >&2 "I require bwm-ng but it's not installed. Aborting."; exit 1; } && export BWMNG=`command -v bwm-ng`
|
|
fi
|
|
if [[ $USE_IOTOP == "true" ]]; then
|
|
command -v iotop >/dev/null 2>&1|| { echo >&2 "I require iotop but it's not installed. Aborting."; exit 1; } && export IOTOP=`command -v iotop`
|
|
fi
|
|
if [[ $USE_MYTOP == "true" ]]; then
|
|
command -v mytop >/dev/null 2>&1|| { echo >&2 "I require mytop but it's not installed. Aborting."; exit 1; } && export MYTOP=`command -v mytop`
|
|
fi
|
|
if [[ $USE_VNSTAT == "true" ]]; then
|
|
command -v vnstat >/dev/null 2>&1|| { echo >&2 "I require vnstat but it's not installed. Aborting."; exit 1; } && export VNSTAT=`command -v vnstat`
|
|
fi
|
|
if [[ $USE_IFTOP == "true" ]]; then
|
|
command -v iftop >/dev/null 2>&1|| { echo >&2 "I require iftop but it's not installed. Aborting."; exit 1; } && export IFTOP=`command -v iftop`
|
|
fi
|
|
if [[ $POWERLINE == "true" ]]; then
|
|
export TMUX_CONF="powerline/tmux.conf"
|
|
else
|
|
export TMUX_CONF="conf/tmux.conf"
|
|
fi
|
|
|