diff --git a/examples/morpheusvm/scripts/deploy.devnet.sh b/examples/morpheusvm/scripts/deploy.devnet.sh index c7de611fd8..9466306698 100755 --- a/examples/morpheusvm/scripts/deploy.devnet.sh +++ b/examples/morpheusvm/scripts/deploy.devnet.sh @@ -173,10 +173,23 @@ EOF # Setup devnet CLUSTER="vryx-$(date +%s)" + +interrupted=false +function showcleanup { + if [ "$interrupted" = false ]; then + echo -e "\n\n${RED}run this command to destroy the devnet:${NC} ${TMPDIR}/avalanche node destroy ${CLUSTER}\n" + fi +} + function cleanup { - echo -e "\n\n${RED}run this command to destroy the devnet:${NC} ${TMPDIR}/avalanche node destroy ${CLUSTER}\n" + interrupted=true + echo -e "\n\n${RED}destroying the devnet, running:${NC} ${TMPDIR}/avalanche node destroy ${CLUSTER}\n" + ${TMPDIR}/avalanche node destroy ${CLUSTER} -y } -trap cleanup EXIT + +trap showcleanup EXIT +trap cleanup SIGINT + # List of supported instances in each AWS region: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-regions.html # # It is not recommended to use an instance with burstable network performance.