Skip to content

Instantly share code, notes, and snippets.

@dumindarw
Created November 1, 2022 05:07
Show Gist options
  • Save dumindarw/64c1113c65bc07eb225660c60564f8c6 to your computer and use it in GitHub Desktop.
Save dumindarw/64c1113c65bc07eb225660c60564f8c6 to your computer and use it in GitHub Desktop.
#!/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