ports/sysutils/smartmontools-devel/files/smartd.in
Renato Botelho f19cf20235 - Update to 5.36 [1]
- Use USE_RC_SUBR=smartd
- Add pkg-message to SUB_FILES facility

PR:		ports/96206 [1]
Submitted by:	Dmitry Morozovsky <marck@freebsd.org> [1]
Reworked by:	garga
Approved by:	maintainer
2006-05-11 17:02:59 +00:00

44 lines
806 B
Bash

#!/bin/sh
# $FreeBSD$
# PROVIDE: smartd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Define these smartd_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/smartd
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
smartd_enable="${smartd_enable-NO}"
smartd_pidfile="/var/run/smartd.pid"
. %%RC_SUBR%%
name="smartd"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/smartd"
load_rc_config $name
: ${smartd_config="%%PREFIX%%/etc/smartd.conf"}
: ${smartd_flags="-c ${smartd_config}"}
pidfile="${smartd_pidfile}"
required_files="${smartd_config}"
case "${smartd_flags}" in
*-p\ *)
echo "ERROR: \$smartd_flags includes -p option." \
"Please use \$smartd_pidfile instead."
exit 1
;;
*)
smartd_flags="-p ${pidfile} ${smartd_flags}"
;;
esac
run_rc_command "$1"