#! /bin/sh
#
# |-----------------------------------------------------------|
# | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
# | All Rights Reserved                                       |
# |-----------------------------------------------------------|
# |          Restricted Rights Legend                         |
# | Use, duplication, or disclosure by the Government is      |
# | subject to restrictions as set forth in                   |
# | subparagraph (c)(1)(ii) of the Rights in Technical        |
# | Data and Computer Software Clause of DFARS 252.227-7013.  |
# |         MIPS Computer Systems, Inc.                       |
# |         950 DeGuigne Avenue                               |
# |         Sunnyvale, California 94088-3650, USA             |
# |-----------------------------------------------------------|
#
# $Header: install_acct,v 1.4.2.1 92/06/24 13:26:07 marker Exp $

etc=/etc
crontab=/usr/spool/cron/crontabs/adm
crontabacct=/usr/lib/acct/crontab.acct

# have we already installed it?
if [ -f ${etc}/init.d/account ] 
then
    echo System V Accounting appears to already have been installed
    echo because ${etc}/init.d/account exists.
    exit 1
fi

echo Installing startup/shutdown...
(cd /etc/init.d; ln -s acct account )

if ( grep -s runacct ${crontab} > /dev/null )
then
    echo $crontab already has runacct in it.
    echo This file has not been altered.
    exit 1
else
    echo adding accounting to $crontab.  You may wish to adjust the times.
    cat $crontab $crontabacct > /tmp/acct$$
    mv /tmp/acct$$ $crontab
fi
