Skip to content

Instantly share code, notes, and snippets.

@eddienko
Created July 22, 2021 12:26
Show Gist options
  • Save eddienko/3a7ddea2d81d39c32b81986ce20be9e9 to your computer and use it in GitHub Desktop.
Save eddienko/3a7ddea2d81d39c32b81986ce20be9e9 to your computer and use it in GitHub Desktop.
#!/bin/sh
errorExit() {
echo "*** $*" 1>&2
exit 1
}
APISERVER_VIP=xxx.xxx.xx.xx
APISERVER_DEST_PORT=6443
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment