Switch to singular case (should only return one)
parent
46886b7d85
commit
60ab2966a2
|
@ -53,14 +53,14 @@ if ! wg_output="$(sudo /usr/bin/wg show "${TLD}" allowed-ips)"; then
|
|||
fi
|
||||
|
||||
# Filter out this user's
|
||||
user_peers="$(grep "${pubkey}" <<<"${wg_output}" 2>/dev/null)"
|
||||
if [ "${user_peers}" == "" ]; then
|
||||
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}"
|
||||
exit 8
|
||||
fi
|
||||
|
||||
# Get peer domains
|
||||
if ! peer="$("${LIB_DIR}/ips_to_peers" tsv <<<"${user_peers}" | 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 'Peer not found\n' | "${LIB_DIR}/http_res" 404
|
||||
exit 6
|
||||
|
|
Loading…
Reference in New Issue