Created
July 22, 2021 12:26
-
-
Save eddienko/3a7ddea2d81d39c32b81986ce20be9e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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