mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
changed cp to mv. Added email category option
merged former dev branch into torrent branch... Auto merge not possible.
This commit is contained in:
parent
cc08553428
commit
29965538a4
1 changed files with 9 additions and 16 deletions
|
@ -184,7 +184,8 @@ do_exit() {
|
||||||
replaceVarBy "${REPLACEDRESULT}" "<cat>" "${NZBPP_CATEGORY}"
|
replaceVarBy "${REPLACEDRESULT}" "<cat>" "${NZBPP_CATEGORY}"
|
||||||
replaceVarBy "${REPLACEDRESULT}" "<script>" "${script}"
|
replaceVarBy "${REPLACEDRESULT}" "<script>" "${script}"
|
||||||
Email_Message="${REPLACEDRESULT}"
|
Email_Message="${REPLACEDRESULT}"
|
||||||
if [ "$Email_successful" = "yes" -a "$nzbStatus" = 0 ]; then
|
for item in $Email_successful; do
|
||||||
|
if [ "${NZBPP_CATEGORY}" = "$item" -a "$nzbStatus" = 0 ]; then
|
||||||
User=""
|
User=""
|
||||||
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
||||||
replaceVarBy "${Email_Subject}" "<status>" "completed"
|
replaceVarBy "${Email_Subject}" "<status>" "completed"
|
||||||
|
@ -192,8 +193,9 @@ do_exit() {
|
||||||
replaceVarBy "${Email_Message}" "<status>" "completed"
|
replaceVarBy "${Email_Message}" "<status>" "completed"
|
||||||
Email_Message="${REPLACEDRESULT}"
|
Email_Message="${REPLACEDRESULT}"
|
||||||
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
||||||
fi
|
fi; done
|
||||||
if [ "$Email_failed" = "yes" -a "$nzbStatus" != 0 ]; then
|
for item in $Email_failed; do
|
||||||
|
if [ "${NZBPP_CATEGORY}" = "$item" -a "$nzbStatus" != 0 ]; then
|
||||||
User=""
|
User=""
|
||||||
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
||||||
replaceVarBy "${Email_Subject}" "<status>" "failed"
|
replaceVarBy "${Email_Subject}" "<status>" "failed"
|
||||||
|
@ -201,7 +203,7 @@ do_exit() {
|
||||||
replaceVarBy "${Email_Message}" "<status>" "failed"
|
replaceVarBy "${Email_Message}" "<status>" "failed"
|
||||||
Email_Message="${REPLACEDRESULT}"
|
Email_Message="${REPLACEDRESULT}"
|
||||||
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
||||||
fi
|
fi; done
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,14 +447,11 @@ fi
|
||||||
# Test for category and ensure the passed directory exists as a directory.
|
# Test for category and ensure the passed directory exists as a directory.
|
||||||
if [ "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -d "$TvDownloadDir" ]; then
|
if [ "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -d "$TvDownloadDir" ]; then
|
||||||
echo "[INFO] Post-Process: Moving TV shows to $TvDownloadDir"
|
echo "[INFO] Post-Process: Moving TV shows to $TvDownloadDir"
|
||||||
cp -R "$NZBPP_DIRECTORY" "$TvDownloadDir"
|
mv "$NZBPP_DIRECTORY" "$TvDownloadDir"
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
echo "[ERROR] Post-Process: Moving to $TvDownloadDir"
|
echo "[ERROR] Post-Process: Moving to $TvDownloadDir"
|
||||||
exit $POSTPROCESS_ERROR
|
exit $POSTPROCESS_ERROR
|
||||||
else
|
else
|
||||||
rm -fr *
|
|
||||||
cd ..
|
|
||||||
rmdir "$NZBPP_DIRECTORY"
|
|
||||||
NZBPP_DIRECTORY="$TvDownloadDir"
|
NZBPP_DIRECTORY="$TvDownloadDir"
|
||||||
cd "$NZBPP_DIRECTORY"
|
cd "$NZBPP_DIRECTORY"
|
||||||
fi
|
fi
|
||||||
|
@ -460,14 +459,11 @@ fi
|
||||||
# Test for category and ensure the passed directory exists as a directory.
|
# Test for category and ensure the passed directory exists as a directory.
|
||||||
if [ "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -d "$MoviesDownloadDir" ]; then
|
if [ "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -d "$MoviesDownloadDir" ]; then
|
||||||
echo "[INFO] Post-Process: Moving Movies to $MoviesDownloadDir"
|
echo "[INFO] Post-Process: Moving Movies to $MoviesDownloadDir"
|
||||||
cp -R "$NZBPP_DIRECTORY" "$MoviesDownloadDir"
|
mv "$NZBPP_DIRECTORY" "$MoviesDownloadDir"
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
echo "[ERROR] Post-Process: Moving to $MoviesDownloadDir"
|
echo "[ERROR] Post-Process: Moving to $MoviesDownloadDir"
|
||||||
exit $POSTPROCESS_ERROR
|
exit $POSTPROCESS_ERROR
|
||||||
else
|
else
|
||||||
rm -fr *
|
|
||||||
cd ..
|
|
||||||
rmdir "$NZBPP_DIRECTORY"
|
|
||||||
NZBPP_DIRECTORY="$MoviesDownloadDir"
|
NZBPP_DIRECTORY="$MoviesDownloadDir"
|
||||||
cd "$NZBPP_DIRECTORY"
|
cd "$NZBPP_DIRECTORY"
|
||||||
fi
|
fi
|
||||||
|
@ -475,14 +471,11 @@ fi
|
||||||
# Test for category and ensure the passed directory exists as a directory.
|
# Test for category and ensure the passed directory exists as a directory.
|
||||||
if [ "$NZBPP_CATEGORY" = "$CustomCategory" -a -d "$CustomDownloadDir" ]; then
|
if [ "$NZBPP_CATEGORY" = "$CustomCategory" -a -d "$CustomDownloadDir" ]; then
|
||||||
echo "[INFO] Post-Process: Moving $CustomCategory to $CustomDownloadDir"
|
echo "[INFO] Post-Process: Moving $CustomCategory to $CustomDownloadDir"
|
||||||
cp -R "$NZBPP_DIRECTORY" "$CustomDownloadDir"
|
mv "$NZBPP_DIRECTORY" "$CustomDownloadDir"
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
echo "[ERROR] Post-Process: Moving to $CustomDownloadDir"
|
echo "[ERROR] Post-Process: Moving to $CustomDownloadDir"
|
||||||
exit $POSTPROCESS_ERROR
|
exit $POSTPROCESS_ERROR
|
||||||
else
|
else
|
||||||
rm -fr *
|
|
||||||
cd ..
|
|
||||||
rmdir "$NZBPP_DIRECTORY"
|
|
||||||
NZBPP_DIRECTORY="$CustomDownloadDir"
|
NZBPP_DIRECTORY="$CustomDownloadDir"
|
||||||
cd "$NZBPP_DIRECTORY"
|
cd "$NZBPP_DIRECTORY"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue