7 # REQUIRE: mountcritremote
15 accounting_command="/usr/sbin/accton"
16 accounting_file="/var/account/acct"
17 start_cmd="accounting_start"
18 stop_cmd="accounting_stop"
24 _dir=`dirname "$accounting_file"`
25 if [ ! -d `dirname "$_dir"` ]; then
26 if ! mkdir -p "$_dir"; then
27 warn "Could not create $_dir."
31 if [ ! -e "$accounting_file" ]; then
32 touch "$accounting_file"
35 if [ ! -f ${accounting_file} ]; then
36 echo "Creating accounting file ${accounting_file}"
37 ( umask 022 ; > ${accounting_file} )
39 echo "Turning on accounting."
40 ${accounting_command} ${accounting_file}
45 echo "Turning off accounting."