New stuff.
[clinton/scripts.git] / check_apache
diff --git a/check_apache b/check_apache
new file mode 100755 (executable)
index 0000000..7eceee1
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# Pass one command-line argument: the URL to try retrieving to see if Apache is working
+
+if wget -q -t 1 -O /dev/null -T 5 $1; then
+  echo "No problem" >/dev/null
+else
+  /etc/init.d/apache2 restart
+  echo "It seemed to be down at `date`." | mail -s "Apache restarted on `hostname`" admins@hcoop.net
+fi