AAXtoMP3: fix how .authcode is located fix issue #60

This commit is contained in:
Reidar Cederqvist 2018-06-07 09:11:47 +02:00
parent 8887bee900
commit db48c6a970

View File

@ -55,17 +55,18 @@ auth_code="";
for dir in $authcodeDirs; do for dir in $authcodeDirs; do
codeFile="${dir}$authcode"; codeFile="${dir}$authcode";
if [ ! -f "$codeFile" -o ! -s "$codeFile" ]; then
codeFile=""
echo "INFO: Sorry, missing or empty \"$codeFile\" found, skipping.";
fi;
done;
if [ ! -f "$codeFile" ]; then if [ ! -f "$codeFile" ]; then
auth_code=$1 auth_code=$1
shift shift
break;
elif [ -s "$codeFile" ]; then
auth_code=`head -1 "$codeFile"`
break;
else else
echo "INFO: Sorry, empty \"$codeFile\" found, skipping."; auth_code=`head -1 "$codeFile"`
fi; fi
done;
if [ -z "$auth_code" ]; then if [ -z "$auth_code" ]; then
echo "INFO: Sorry, no authcode provided."; echo "INFO: Sorry, no authcode provided.";