Created
November 1, 2022 05:07
-
-
Save dumindarw/64c1113c65bc07eb225660c60564f8c6 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 | |
# wait-for-ksql-server.sh | |
set -e | |
while [ $(curl -s -o response.txt -w "%{http_code}" http://ksql-server:8088/info) -ne 200 ]; | |
do | |
>&2 echo "KSQL Server is unavailable - retrying" | |
sleep 1 | |
done | |
>&2 echo "KSQL Server is up" | |
ksql --file /ksql/queries.sql -- http://ksql-server:8088 | |
# Print and execute all other arguments starting with `$1` | |
# So `exec "$1" "$2" "$3" ...` | |
keepgoing=1 | |
trap '{ echo "sigint"; keepgoing=0; }' SIGINT | |
while (( keepgoing )); do | |
#echo "sleeping" | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment