#!/ffp/bin/sh # cfp post-processing script for NZBGet wusamba wusamba {at] gmail [D o T} com ################################################################################ ### NZBGET POST-PROCESSING SCRIPT ### # Change file permission. ################################################################################ ### OPTIONS ### # Put user here. user=user # Put group here. group=group # Set owner (yes, no). setowner=no # Put mode here. mode=666 # Set mode (yes, no). setmode=no ### NZBGET POST-PROCESSING SCRIPT ### ################################################################################ # Exit codes #POSTPROCESS_PARCHECK=92 #POSTPROCESS_SUCCESS=93 POSTPROCESS_ERROR=94 #POSTPROCESS_NONE=95 POSTPROCESS=95 # Check if the script is called from nzbget 11.0 or later if [ "$NZBOP_SCRIPTDIR" = "" ]; then echo "*** NZBGet post-processing script ***" echo "This script is supposed to be called from nzbget (11.0 or later)." exit $POSTPROCESS_ERROR fi # Check if directory exists if [ -d "$NZBPP_DIRECTORY" ]; then # chown if [ "$NZBPO_SETOWNER" = "yes" ]; then if (chown $NZBPO_USER:$NZBPO_GROUP -R "$NZBPP_DIRECTORY"); then echo "[INFO] Permission set" POSTPROCESS=93 else echo "[WARN] Permission not set" exit $POSTPROCESS_ERROR fi fi # chmod if [ "$NZBPO_SETMODE" = "yes" ]; then if (chmod $NZBPO_MODE -R "$NZBPP_DIRECTORY"); then echo "[INFO] Mode set" POSTPROCESS=93 else echo "[WARN] Mode not set" exit $POSTPROCESS_ERROR fi fi else echo "[WARN] Directory not found" echo "[DETAIL] $NZBPP_DIRECTORY" exit $POSTPROCESS fi exit $POSTPROCESS