2022-08-09 18:36:54 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-11-07 20:43:14 +00:00
|
|
|
HEALTHCHECK_RECORD=healthcheck.unbound
|
|
|
|
EXPECTED_VALUE=127.0.0.1
|
2022-08-09 18:36:54 +00:00
|
|
|
|
|
|
|
RESOLVED_IP=$(nslookup "${HEALTHCHECK_RECORD}" 127.0.0.1 | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
|
|
|
|
if [ "${RESOLVED_IP}" != "${EXPECTED_VALUE}" ]; then
|
|
|
|
echo "[ERR] ${HEALTHCHECK_RECORD} lookup failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "[OK] ${HEALTHCHECK_RECORD} == ${RESOLVED_IP}"
|