Annotation of embedaddon/thttpd/scripts/thttpd_wrapper, revision 1.1.1.1

1.1       misho       1: #!/bin/sh
                      2: #
                      3: # thttpd_wrapper - wrapper script for thttpd on FreeBSD
                      4: #
                      5: # This goes in /usr/local/sbin.  It runs thttpd in a loop.  If thttpd
                      6: # exits then the script restarts it automatically.
                      7: #
                      8: # The -D flag tells thttpd to *not* put itself into the background,
                      9: # and the -C flag tells it to get the rest of its configuration from
                     10: # the specified config file.
                     11: 
                     12: while true ; do
                     13:     /usr/local/sbin/thttpd -D -C /usr/local/www/thttpd_config
                     14:     if [ -f /var/run/nologin ] ; then
                     15:        exit
                     16:     fi
                     17:     sleep 10
                     18:     egrep ' thttpd\[' /var/log/messages |
                     19:       tail -33 |
                     20:       mail -s "thttpd on `hostname` restarted" root
                     21: done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>