Fixed logging
parent
21a31085ba
commit
f962c906ae
|
@ -48,9 +48,7 @@ fi
|
||||||
if ! domain="$("${LIB_DIR}/ns_lookup_rdns" "${ip}")"; then
|
if ! domain="$("${LIB_DIR}/ns_lookup_rdns" "${ip}")"; then
|
||||||
printf 'ERROR! Failed to lookup domain from user IP %s\n' "${ip}" | tee -a "${LOGFILE}" | "${LIB_DIR}/http_res" 500
|
printf 'ERROR! Failed to lookup domain from user IP %s\n' "${ip}" | tee -a "${LOGFILE}" | "${LIB_DIR}/http_res" 500
|
||||||
exit 7
|
exit 7
|
||||||
fi
|
fi; if ! username="$(<<<"${domain}" cut -d'.' -f2)"; then
|
||||||
printf "${domain}" >>"${LOGFILE}"
|
|
||||||
if ! username="$(<<<"${domain}" cut -d'.' -f2)"; then
|
|
||||||
printf 'ERROR! Failed to parse username from domain "%s"\n' "${domain}" >>"${LOGFILE}"
|
printf 'ERROR! Failed to parse username from domain "%s"\n' "${domain}" >>"${LOGFILE}"
|
||||||
"${LIB_DIR}/http_res" 500
|
"${LIB_DIR}/http_res" 500
|
||||||
exit 8
|
exit 8
|
||||||
|
@ -71,7 +69,7 @@ if ! [ -f "${path}" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try to return it to the user
|
# Try to return it to the user
|
||||||
if ! <"${file}" "${LIB_DIR}/http_res" 200; then
|
if ! <"${path}" "${LIB_DIR}/http_res" 200; then
|
||||||
printf 'ERROR! Failed to return file: "%s"\n' | tee -a "${LOGFILE}" | "${LIB_DIR}/http_res" 500
|
printf 'ERROR! Failed to return file: "%s"\n' "${path}" | tee -a "${LOGFILE}" | "${LIB_DIR}/http_res" 500
|
||||||
exit 11
|
exit 11
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue