Skip to content

Instantly share code, notes, and snippets.

@jonsagara
Last active January 30, 2021 19:05
Show Gist options
  • Save jonsagara/ff972fe2e9c2648ebc370c98c95851f9 to your computer and use it in GitHub Desktop.
Save jonsagara/ff972fe2e9c2648ebc370c98c95851f9 to your computer and use it in GitHub Desktop.
Start elasticsearch and kibana on macOS
#!/bin/bash
#
# Start elasticsearch in a new Terminal window.
#
echo "Starting elasticsearch in a new Terminal.app window..."
# See: https://stackoverflow.com/a/989357/731
osascript -e 'tell application "Terminal" to do script "~/Downloads/elasticsearch-7.10.2/bin/elasticsearch"'
echo "Done."
#
# elasticsearch takes a bit to initialize and be ready to accept connections. Sleep for a bit before
# starting kibana to avoid reams of exceptions when it can't yet connect to elasticsearch.
#
waitTime="10"
echo "Waiting $waitTime seconds for elasticsearch to initialize..."
sleep $waitTime
#
# Start kibana in a new Terminal window.
#
echo "Starting kibana in a new Terminal.app window..."
osascript -e 'tell application "Terminal" to do script "~/Downloads/kibana-7.10.2-darwin-x86_64/bin/kibana"'
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment