Fixed log error messages

master
Keith Irwin 2022-11-07 12:21:43 -07:00
parent 60ab2966a2
commit cb5b44244d
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 2 additions and 2 deletions

View File

@ -55,13 +55,13 @@ fi
# Filter out this user's
user_peer="$(grep "${pubkey}" <<<"${wg_output}" 2>/dev/null)"
if [ "${user_peer}" == "" ]; then
printf "ERROR! %s accessed the dashboard but isn't on the network!\n" "${ip}" >>"${LOGFILE}"
printf "ERROR! Could not find user for pubkey %s!\n" "${pubkey}" >>"${LOGFILE}"
exit 8
fi
# Get peer domains
if ! peer="$("${LIB_DIR}/ips_to_peers" tsv <<<"${user_peer}" | grep "${pubkey}")"; then
printf 'ERROR! Peer %s not found!\n' "${pubkey}" >>"${LOGFILE}" &
printf 'ERROR! Failed to lookup domain for pubkey %s!\n' "${pubkey}" >>"${LOGFILE}" &
printf 'Peer not found\n' | "${LIB_DIR}/http_res" 404
exit 6
fi