Thus the structure of the password file has to be:
Code: Select all
#Header: xxxxxx
#Pass: yyyyy
#
#Header: xxxxxx
#Pass: yyyyy
#
#Header: xxxxxx
#Pass: yyyyy
script:
Code: Select all
#!/bin/sh
#-----------------------------------------------------------------------
#NZBGet >11 Post-Processing-Script
#-----------------------------------------------------------------------
##############################################################################
### NZBGET SCAN SCRIPT
# Get password from password file.
# Structure of password file:
#Header: xxxxxx
#Pass: yyyyy
#
#Header: xxxxxx
#Pass: yyyyy
#
#Header: xxxxxx
#Pass: yyyyy
##############################################################################
### OPTIONS ###
#inputpath=
#inputfile=
### NZBGET SCAN SCRIPT
inputext=$NZBNP_NZBNAME
input=$(echo "$inputext" | cut -f 1 -d '.')
#constants:
nzb_success=2
pref_corrupt=0
success=93
failure=94
none=95
inputfile=$NZBPO_inputpath$NZBPO_inputfile
echo "using passfile: $inputfile"
echo "searching for: $input"
echo "(grep -1 $input $inputfile)"
pass=$(grep -1 $input $inputfile)
echo "found pass" $pass
string=$pass
if [[ $string == *":"* ]]; then
{
echo ": found, cleaning"
cleaned=$(echo $string | cut -d':' -f3)
cleanedws=$(echo $cleaned | xargs)
echo "using password" $cleanedws
echo "[NZB] NZBPR_*Unpack:Password=$cleanedws"
}
exit $success
fi
exit $failure