3 # $NetBSD: accounting,v 1.7 2002/03/22 04:33:57 thorpej Exp $
8 # REQUIRE: mountcritremote
16 accounting_command="/usr/sbin/accton"
17 accounting_file="/var/account/acct"
18 start_cmd="accounting_start"
19 stop_cmd="accounting_stop"
25 _dir=`dirname "$accounting_file"`
26 if [ ! -d `dirname "$_dir"` ]; then
27 if ! mkdir -p "$_dir"; then
28 warn "Could not create $_dir."
32 if [ ! -e "$accounting_file" ]; then
33 touch "$accounting_file"
36 if [ ! -f ${accounting_file} ]; then
37 echo "Creating accounting file ${accounting_file}"
38 ( umask 022 ; > ${accounting_file} )
40 echo "Turning on accounting."
41 ${accounting_command} ${accounting_file}
46 echo "Turning off accounting."