Skip to content

Instantly share code, notes, and snippets.

@nguyentruongtho
Last active December 19, 2019 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nguyentruongtho/a6c17a65a9c84e5c48c12f492a42d800 to your computer and use it in GitHub Desktop.
Save nguyentruongtho/a6c17a65a9c84e5c48c12f492a42d800 to your computer and use it in GitHub Desktop.
msvn.sh
#!/usr/bin/env bash
if [[ "$MYSQL_CONNECTION_URL" == *":13306"* ]]; then
# if local db server is enabled (which should be tunneled in by chisel)
chmod +x ./chisel
./chisel server --reverse --uds --port $PORT --proxy "http://localhost:${FORWARD_PORT:-8081}/" &
while true; do
# wait for the db server to be ready
if (grep -v "rem_address" /proc/net/tcp|grep ':33FA' 1>/dev/null); then
echo "Local database started!"
break
fi
sleep 1
done
fi
java -cp $(ls *.jar | paste -sd ':' -) server.Start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment