From 21c7878facd3ee777a5ab4122c5f84cfc8f4e15e Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Mon, 6 Nov 2017 08:47:24 +0000 Subject: [PATCH] add code to make sure instance is ready --- demo-2/script.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/demo-2/script.sh b/demo-2/script.sh index ee8c519..6a35942 100644 --- a/demo-2/script.sh +++ b/demo-2/script.sh @@ -1,3 +1,13 @@ #!/bin/bash + +# sleep until instance is ready +until [[ -f /var/lib/cloud/instance/boot-finished ]]; do + sleep 1 +done + +# install nginx apt-get update apt-get -y install nginx + +# make sure nginx is started +service nginx start