literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
31 lines
578 B
Bash
31 lines
578 B
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: termlog
|
|
# REQUIRE: cron devfs syslogd
|
|
|
|
. /etc/rc.subr
|
|
|
|
load_rc_config termlog
|
|
|
|
name=termlog
|
|
rcvar=termlog_enable
|
|
|
|
command="/usr/local/bin/termlog"
|
|
|
|
# default to disable
|
|
termlog_enable=${termlog_enable:-"NO"}
|
|
# logging path
|
|
termlog_log_dir=${termlog_log_dir:-"/var/log/termlog/"}
|
|
# maximum monitored consoles
|
|
termlog_max_cons=${termlog_max_cons:-"30"}
|
|
termlog_flags=${termlog_flags:-" -C $termlog_log_dir -f -n $termlog_max_cons &"}
|
|
|
|
start_precmd=start_precmd
|
|
|
|
start_precmd()
|
|
{
|
|
mkdir -p $termlog_log_dir
|
|
chmod 0700 $termlog_log_dir
|
|
}
|
|
|
|
run_rc_command "$1"
|