Fixed logging

master
Keith Irwin 2022-11-06 18:26:14 -07:00
parent 21a31085ba
commit f962c906ae
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 3 additions and 5 deletions

View File

@ -48,9 +48,7 @@ fi
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
exit 7
fi
printf "${domain}" >>"${LOGFILE}"
if ! username="$(<<<"${domain}" cut -d'.' -f2)"; then
fi; if ! username="$(<<<"${domain}" cut -d'.' -f2)"; then
printf 'ERROR! Failed to parse username from domain "%s"\n' "${domain}" >>"${LOGFILE}"
"${LIB_DIR}/http_res" 500
exit 8
@ -71,7 +69,7 @@ if ! [ -f "${path}" ]; then
fi
# Try to return it to the user
if ! <"${file}" "${LIB_DIR}/http_res" 200; then
printf 'ERROR! Failed to return file: "%s"\n' | tee -a "${LOGFILE}" | "${LIB_DIR}/http_res" 500
if ! <"${path}" "${LIB_DIR}/http_res" 200; then
printf 'ERROR! Failed to return file: "%s"\n' "${path}" | tee -a "${LOGFILE}" | "${LIB_DIR}/http_res" 500
exit 11
fi