Browse Source

Script to check for HTTP codes

David Yurkiewicz 5 years ago
parent
commit
25bd5e5d6a
1 changed files with 20 additions and 0 deletions
  1. 20 0
      linux/rigorThis.sh

+ 20 - 0
linux/rigorThis.sh

@@ -0,0 +1,20 @@
1
+#!/bin/bash
2
+#################################
3
+# RigorThis
4
+# by David Yurkiewicz
5
+# WWW.D87STUDIOS.COM
6
+## Check Site for HTTP error codes
7
+# USAGE: ./rigorThis.sh google.com
8
+##################################
9
+
10
+
11
+SITE=$1
12
+
13
+test=$(curl -I "$SITE" 2>|/dev/null | grep HTTP/1.1) && echo -e "\n`date` ${test}" | grep 200
14
+
15
+if [ $? -ne 0 ] ; then
16
+	curl -iD /tmp/HTTP-checks/`date +"%F_%H:%M"`-HTTPhead.log $SITE
17
+else 
18
+  echo "No issue to report"
19
+fi
20
+