fixed token_fail not found
parent
66f3fe642c
commit
35eea41743
|
@ -54,9 +54,9 @@ token_fail(){
|
||||||
printf 'Rejecting %s request for new peer due to %s token\n' "${ip}" "${1}" >>"${LOGFILE}"
|
printf 'Rejecting %s request for new peer due to %s token\n' "${ip}" "${1}" >>"${LOGFILE}"
|
||||||
printf 'Invalid token\n' | "${LIB_DIR}/http_res" 403
|
printf 'Invalid token\n' | "${LIB_DIR}/http_res" 403
|
||||||
exit 8
|
exit 8
|
||||||
} &
|
}
|
||||||
saved_token="$(grep "${ip}" "${TOKENS_FILE}" | cut -f2)"
|
saved_token="$(grep "${ip}" "${TOKENS_FILE}" | cut -f2)"
|
||||||
[ "${saved_token}" == "" ] && token_fail 'missing'
|
[ "${saved_token}" == "" ] && token_fail 'missing' &
|
||||||
<<<"${qs}" grep -qx "t=${saved_token}" || token_fail 'mismatched'
|
<<<"${qs}" grep -qx "t=${saved_token}" || token_fail 'mismatched'
|
||||||
printf '%s token was valid\n' "${ip}" >>"${LOGFILE}"
|
printf '%s token was valid\n' "${ip}" >>"${LOGFILE}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue