cka-SVV/check_apiserver.sh
2020-11-04 09:22:09 +01:00

13 lines
484 B
Bash
Executable File

APISERVER_VIP=192.168.4.100
APISERVER_DEST_PORT=6443
errorExit() {
echo "* * * $*" 1>&2
exit 1
}
curl --silent --max-time 2 --insecure https://localhost:${APISERVER_DEST_PORT}/ -o /dev/null || errorExit "Error GET https://localhost:${APISERVER_DEST_PORT}/"
if ip addr | grep -q ${APISERVER_VIP}; then
curl --silent --max-time 2 --insecure https://${APISERVER_VIP}:${APISERVER_DEST_PORT}/ -o /dev/null || errorExit "Error GET https://${APISERVER_VIP}:${APISERVER_DEST_PORT}/"
fi