summaryrefslogtreecommitdiff
path: root/scripts/mini_httpd_wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mini_httpd_wrapper')
-rwxr-xr-xscripts/mini_httpd_wrapper21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/mini_httpd_wrapper b/scripts/mini_httpd_wrapper
new file mode 100755
index 0000000..d197d79
--- /dev/null
+++ b/scripts/mini_httpd_wrapper
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# mini_httpd_wrapper - wrapper script for mini_httpd on FreeBSD
+#
+# This goes in /usr/local/sbin. It runs mini_httpd in a loop. If mini_httpd
+# exits then the script restarts it automatically.
+#
+# The -D flag tells mini_httpd to *not* put itself into the background,
+# and the -C flag tells it to get the rest of its configuration from
+# the specified config file.
+
+while true ; do
+ /usr/local/sbin/mini_httpd -D -C /usr/local/www/mini_httpd_config
+ if [ -f /var/run/nologin ] ; then
+ exit
+ fi
+ sleep 10
+ egrep ' mini_httpd\[' /var/log/messages |
+ tail -33 |
+ mail -s "mini_httpd on `hostname` restarted" root
+done