Skip to content

Instantly share code, notes, and snippets.

@lubien
Created April 5, 2024 16:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lubien/eee77fc8ad73625cbe3419f7157d8e6a to your computer and use it in GitHub Desktop.
Save lubien/eee77fc8ad73625cbe3419f7157d8e6a to your computer and use it in GitHub Desktop.
#!/bin/bash
cleanup() {
echo "destroy your machine"
fly m destroy --force
exit 0
}
trap 'cleanup' SIGINT
# Run the first command in the background
fly m run -e LIVEBOOK_IP="::" --rm ghcr.io/livebook-dev/livebook:0.11.3 && open http://localhost:8080 && fly proxy 8080:8080 &
# Store the PID (process ID) of the first command
pid=$!
# Loop until the first command is no longer running
while ps -p $pid > /dev/null; do
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment