#!/bin/sh
# Title: clean_logs
# Author: B. Alcock <alcockba@boat.bt.com>
# Last updated: Fri 02/01/1998

# Log files to clean
LOG_FILES="		\
	aculog		\
	lastlog		\
	messages	\
	messages.0	\
	spellhist	\
	sulog		\
	tape_log	\
	tape_log.2	\
	vold.log	\
	"

# Base directory of log files
LOG_DIR=/var/adm/

for i in $LOG_FILES ; do
	if [ -f $LOG_DIR$i ] ; then
		if [ -w $LOG_DIR$i ] ; then
			/usr/ucb/echo -n "" >$LOG_DIR$i
		else
			chmod u+w $LOG_DIR$i
			/usr/ucb/echo -n "" >$LOG_DIR$i
			chmod u-w $LOG_DIR$i
		fi
	fi
done

