From 7ab69f77896aea30879178ef612c44542246b52f Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Tue, 11 Dec 2012 14:41:03 -0800 Subject: [PATCH] Don't use custom dir if not passed in conf --- nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index 41cc5867..1435df9f 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -342,7 +342,8 @@ fi ############################ # Move categories to /share/yourdirectory and remove download destination directory -if [ "$NZBPP_CATEGORY" = "$SickBeardCategory" ]; then +# Test for category and ensure the passed directory exists as a directory. +if [ "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -d "$TvDownloadDir" ]; then echo "[INFO] Post-Process: Moving TV shows to $TvDownloadDir" cp -R "$NZBPP_DIRECTORY" "$TvDownloadDir" >/dev/null 2>&1 if [ "$?" -ne 0 ]; then @@ -355,8 +356,8 @@ if [ "$NZBPP_CATEGORY" = "$SickBeardCategory" ]; then NZBPP_DIRECTORY="$TvDownloadDir" fi fi - -if [ "$NZBPP_CATEGORY" = "$CouchPotatoCategory" ]; then +# Test for category and ensure the passed directory exists as a directory. +if [ "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -d "$MoviesDownloadDir" ]; then echo "[INFO] Post-Process: Moving Movies to $MoviesDownloadDir" cp -R "$NZBPP_DIRECTORY" "$MoviesDownloadDir" >/dev/null 2>&1 if [ "$?" -ne 0 ]; then