#!/bin/sh
# writelog - write a log-entry to an Adminlog database

# Assuming HOME points to the user's home-directory
if [ -f $HOME/.adminlog ]
then
	err=`/usr/local/Adminlog/adminlog $HOME/.adminlog -w $1`
else
	err=`/usr/local/Adminlog/adminlog /usr/local/Adminlog/adminlog.ini -w $1`
fi

# Send a mail to the users that are listed in file '/usr/local/Adminlog/.alusers.
# The file .alusers may look like this (one line!):
#
# jamesm, lizame, frankieb
#
# This implies that 'jamesb' doesn't want notification.
#
# The file '/usr/local/Adminlog/.al.message' is a file with a suitable message in
# it, for example (may contain one or more lines):
#
# I wrote a new Adminlog-entry!
#
# NOTE:
# You may think of a better way to notify users on your site!
#
# If you don't want to send any mail to anybody, just comment out the following
# lines with "#":

# Notification:
if [ err -eq 0 ]
then
	mail -s "New entry to Adminlog" < /usr/local/Adminlog/.al.message < /usr/local/Adminlog/.alusers
fi

# end of writelog
