Dwatch - A Daemon Watcher
#!/bin/sh
# If the file oldnews.shtml is present, it will contain a list of
# all the release notes. In that case we only need to list the most
# recent one here.
oldnews()
{
f=`echo $news|cut -f 1 -d ' '`
s=`basename $f .shtml | cut -c 6-`
echo "News in $s"
echo ""
echo "Old news"
echo " "
exit
}
test -n "$QUERY_STRING" || exit
dir=/var/www/vhosts/"$QUERY_STRING"
cd "$dir" || exit
echo "Content-type: text/html"
echo
news=`ls -t news-*.shtml`
c1="#99ccff"
c2="#ffffff"
bgcolor="$c1"
test -f oldnews.shtml && oldnews
echo " "
for f in $news; do
s=`basename $f .shtml | cut -c 6-`
echo ""
echo "News in $s"
echo " | "
if test "$bgcolor" = "$c1"; then
bgcolor="$c2"
else
bgcolor="$c1"
fi
done
echo " "
Dwatch (Daemon Watch) is a program that watches over other programs
and performs actions based on conditions specified in a configuration file.
See dwatch.conf for an example of what the file might look like.
Dwatch is meant to be run from cron at regular intervals.
This program is known to work on Linux and Solaris. Other Unixes
should work as well; editing the Makefile may be necessary.
I am Ulric Eriksson, ulric@siag.nu.
Change log
Installation
No configuration script for this program, just type:
make
make install
By default the programs are installed in /usr/local/bin. This can
be changed like this example:
make install PREFIX=/usr
to install into /usr/bin instead.
Download source
Suse RPM courtesy of Pascal Bleser
More stuff
#!/bin/sh
echo "Content-type: text/html"
echo
echo ""
Ulric Eriksson - August 2001 - ulric@siag.nu
|