Fixed log error messages
parent
60ab2966a2
commit
cb5b44244d
|
@ -55,13 +55,13 @@ fi
|
||||||
# Filter out this user's
|
# Filter out this user's
|
||||||
user_peer="$(grep "${pubkey}" <<<"${wg_output}" 2>/dev/null)"
|
user_peer="$(grep "${pubkey}" <<<"${wg_output}" 2>/dev/null)"
|
||||||
if [ "${user_peer}" == "" ]; then
|
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
|
exit 8
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get peer domains
|
# Get peer domains
|
||||||
if ! peer="$("${LIB_DIR}/ips_to_peers" tsv <<<"${user_peer}" | grep "${pubkey}")"; then
|
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
|
printf 'Peer not found\n' | "${LIB_DIR}/http_res" 404
|
||||||
exit 6
|
exit 6
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue