Fixed single user check
parent
10ca5097ba
commit
a9c2564292
|
@ -31,7 +31,7 @@ if ! [ -f "${TOKENS_FILE}" ]; then
|
|||
fi
|
||||
ip="${1}"
|
||||
qs="$(<<<"${2}" tr '&' '\n' | sed 's/?//')"
|
||||
un="$(<<<"${qs}" grep -oP 'un=(.*)' | sed 's/^un//' | xargs)"
|
||||
un="$(<<<"${qs}" grep -oP 'un=(.*)' | sed 's/^un=//' | xargs)"
|
||||
|
||||
printf '%s requested peer listing...\n' "${ip}" >>"${LOGFILE}"
|
||||
|
||||
|
@ -63,7 +63,7 @@ fi
|
|||
# Get domains for each peer
|
||||
if peers="[$("${LIB_DIR}/wg_peer_list" json <<<"${peers}")]"; then
|
||||
printf '{"token":"%s","peers":%s}' "${token}" "${peers}" | "${LIB_DIR}/http_res" 200 'application/json'
|
||||
printf 'Sent usernumber peers to admin %s\n' "${ip}" >>"${LOGFILE}"
|
||||
printf 'Sent peers to admin %s\n' "${ip}" >>"${LOGFILE}"
|
||||
else
|
||||
printf 'ERROR: Failed to lookup user: %s\n' "${ip}" >>"${LOGFILE}"
|
||||
printf 'Failed to lookup rdns' | "${LIB_DIR}/http_res" 500
|
||||
|
|
Loading…
Reference in New Issue