Explorar el Código

Provide error messages when failing

Zachary Kotlarek hace 9 años
padre
commit
2ae1243895
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      download.sh

+ 2 - 0
download.sh

@@ -39,6 +39,7 @@ if [ -n "${TRANS_URL}" ] && echo "${URLS}" | head -n 1 | grep -Eqi '^magnet:'; t
 				--header "${SESSION_ID}" "${TRANS_URL}" \
 				-d '{"method":"torrent-add", "arguments":{"paused": "false", "filename": "'${i}'"}}'`"
 			if ! echo "${RESULT}" | grep -q '"result":"success"'; then
+				echo "${RESULT}" 1>&2
 				exit 10
 			fi
 		done
@@ -60,6 +61,7 @@ elif [ -n "${NZB_URL}" ] && echo "${URLS}" | head -n 1 | grep -Eqi '\/(getnzb\/|
 			RESULT="`curl -k --silent --max-time "${TIMEOUT}" "${NZB_URL}" \
 				-d '{"method":"append","params":["'"${NAME}"'.nzb","'"${URL}"'","",0,false,false,"",0,"force"]}'`"
 			if ! echo "${RESULT}" | grep 'result' | grep -q '[1-9]'; then
+				echo "${RESULT}" 1>&2
 				exit 11
 			fi
 		done