From 3ff75fef47b76473d8d6b56d64a9d2effe9233c6 Mon Sep 17 00:00:00 2001 From: Gregan Date: Thu, 29 Jul 2021 18:23:09 +0200 Subject: [PATCH] ajout tests --- headers | 10 ++++++++++ testWeb.sh | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 headers diff --git a/headers b/headers new file mode 100644 index 0000000..51b6d00 --- /dev/null +++ b/headers @@ -0,0 +1,10 @@ +HTTP/1.1 200 OK +Server: nginx/1.21.1 +Date: Thu, 29 Jul 2021 16:22:12 GMT +Content-Type: text/html +Content-Length: 17678 +Last-Modified: Thu, 29 Jul 2021 08:52:10 GMT +Connection: keep-alive +ETag: "61026c3a-450e" +Accept-Ranges: bytes + diff --git a/testWeb.sh b/testWeb.sh index 54a9cac..a49ea35 100755 --- a/testWeb.sh +++ b/testWeb.sh @@ -3,7 +3,8 @@ echo "TEST HUGO" url=http://localhost:6060 curl ${url} -I -o headers -s -if((cat headers | head -n 1 | cut '-d ' '-f2')==200) +reponse=$(cat headers | head -n 1 | cut '-d ' '-f2') +if [ $reponse == "200" ] then exit 0 fi