From 46886b7d85c8e7ae10d5851e4503ce0f44192a8b Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Mon, 7 Nov 2022 12:17:40 -0700 Subject: [PATCH] Fix admin deleting peer --- back/lib/admin/peer/del | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/back/lib/admin/peer/del b/back/lib/admin/peer/del index a118ecd..28e90d0 100755 --- a/back/lib/admin/peer/del +++ b/back/lib/admin/peer/del @@ -53,7 +53,7 @@ if ! wg_output="$(sudo /usr/bin/wg show "${TLD}" allowed-ips)"; then fi # Filter out this user's -user_peers="$(grep "${ip%[.:]*}" <<<"${wg_output}" 2>/dev/null)" +user_peers="$(grep "${pubkey}" <<<"${wg_output}" 2>/dev/null)" if [ "${user_peers}" == "" ]; then printf "ERROR! %s accessed the dashboard but isn't on the network!\n" "${ip}" >>"${LOGFILE}" exit 8 @@ -61,7 +61,7 @@ fi # Get peer domains if ! peer="$("${LIB_DIR}/ips_to_peers" tsv <<<"${user_peers}" | grep "${pubkey}")"; then - printf 'ERROR! Peer %s not found for user %s!\n' "${pubkey}" "${ip}" >>"${LOGFILE}" & + printf 'ERROR! Peer %s not found!\n' "${pubkey}" >>"${LOGFILE}" & printf 'Peer not found\n' | "${LIB_DIR}/http_res" 404 exit 6 fi