Created
April 5, 2024 16:27
-
-
Save lubien/eee77fc8ad73625cbe3419f7157d8e6a 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/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