mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Updated to latest version from nzbGet r581
This commit is contained in:
parent
bc1693f4ca
commit
1a497a75f8
1 changed files with 52 additions and 30 deletions
|
@ -257,16 +257,13 @@ if [ "$NZBPR_PostProcess" = "no" ]; then
|
|||
exit $POSTPROCESS_NONE
|
||||
fi
|
||||
|
||||
echo "[INFO] Post-Process: Post-process script successfully started"
|
||||
echo "[INFO] Post-Process: Post-processing script successfully started"
|
||||
cd "$NZBPP_DIRECTORY"
|
||||
|
||||
# Determine the location of configuration file (it must be stored in
|
||||
# the directory with nzbget.conf or in this script's directory).
|
||||
# the directory with nzbget.conf).
|
||||
ConfigDir="${NZBOP_CONFIGFILE%/*}"
|
||||
ScriptConfigFile="$ConfigDir/$SCRIPT_CONFIG_FILE"
|
||||
if [ ! -f "$ScriptConfigFile" ]; then
|
||||
ConfigDir="${0%/*}"
|
||||
ScriptConfigFile="$ConfigDir/$SCRIPT_CONFIG_FILE"
|
||||
fi
|
||||
if [ ! -f "$ScriptConfigFile" ]; then
|
||||
echo "[ERROR] Post-Process: Configuration file $ScriptConfigFile not found, exiting"
|
||||
exit $POSTPROCESS_ERROR
|
||||
|
@ -283,26 +280,51 @@ if [ "$NZBOP_ALLOWREPROCESS" = "yes" ]; then
|
|||
BadConfig=1
|
||||
fi
|
||||
|
||||
if [ "$NZBOP_UNPACK" != "yes" ]; then
|
||||
echo "[ERROR] Post-Process: Please enable option \"Unpack\" in nzbget configuration file"
|
||||
BadConfig=1
|
||||
fi
|
||||
|
||||
if [ "$BadConfig" -eq 1 ]; then
|
||||
echo "[ERROR] Post-Process: Exiting due to incompatible nzbget configuration"
|
||||
exit $POSTPROCESS_ERROR
|
||||
fi
|
||||
|
||||
# Check par status
|
||||
if [ "$NZBPP_PARSTATUS" -eq 1 -o "$NZBPP_PARSTATUS" -eq 3 ]; then
|
||||
if [ "$NZBPP_PARSTATUS" -eq 3 ]; then
|
||||
echo "[WARNING] Post-Process: Par-check successful, but Par-repair disabled, exiting"
|
||||
else
|
||||
echo "[WARNING] Post-Process: Par-check failed, exiting"
|
||||
do_exit $POSTPROCESS_NONE
|
||||
fi
|
||||
if [ "$NZBPP_PARSTATUS" -eq 1 ]; then
|
||||
echo "[WARNING] Post-Process: Par-check failed, exiting"
|
||||
do_exit $POSTPROCESS_NONE
|
||||
fi
|
||||
|
||||
# Check unpack status
|
||||
if [ "$NZBPP_UNPACKSTATUS" -ne 2 ]; then
|
||||
echo "[WARNING] Post-Process: Unpack failed or disabled, exiting"
|
||||
if [ "$NZBPP_UNPACKSTATUS" -eq 1 ]; then
|
||||
echo "[WARNING] Post-Process: Unpack failed, exiting"
|
||||
do_exit $POSTPROCESS_NONE
|
||||
fi
|
||||
if [ "$NZBPP_UNPACKSTATUS" -eq 0 -a "$NZBPP_PARSTATUS" -ne 2 ]; then
|
||||
# Unpack is disabled or was skipped due to nzb-file properties or due to errors during par-check
|
||||
|
||||
if (ls *.rar *.7z *.7z.??? >/dev/null 2>&1); then
|
||||
echo "[WARNING] Post-Process: Archive files exist but unpack skipped, exiting"
|
||||
exit $POSTPROCESS_NONE
|
||||
fi
|
||||
|
||||
if (ls *.par2 >/dev/null 2>&1); then
|
||||
echo "[WARNING] Post-Process: Unpack skipped and par-check skipped (although par2-files exist), exiting"
|
||||
exit $POSTPROCESS_NONE
|
||||
fi
|
||||
|
||||
if [ -f "_brokenlog.txt" ]; then
|
||||
echo "[WARNING] Post-Process: _brokenlog.txt exists, download is probably damaged, exiting"
|
||||
exit $POSTPROCESS_NONE
|
||||
fi
|
||||
|
||||
echo "[INFO] Post-Process: Neither archive- nor par2-files found, _brokenlog.txt doesn't exist, considering download successful"
|
||||
fi
|
||||
|
||||
# Check if destination directory exists (important for reprocessing of history items)
|
||||
if [ ! -d "$NZBPP_DIRECTORY" ]; then
|
||||
|
@ -343,12 +365,12 @@ if [ "$JoinTS" = "yes" ]; then
|
|||
echo "[INFO] Post-Process: Joining ts-files"
|
||||
tsname=`find . -name "*0001.ts" |awk -F/ '{print $NF}'`
|
||||
cat *0???.ts > ./$tsname
|
||||
fi
|
||||
|
||||
# Remove all the split .ts files
|
||||
echo "[INFO] Post-Process: Deleting source ts-files"
|
||||
rm *0???.ts >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$RenameIMG" = "yes" ]; then
|
||||
# Rename img file to iso
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue