freebsd-ports/sysutils/smartmontools-devel/files/smartd.sh
Norikatsu Shigemura 2fe26720b8 Oops, fix handling pidfile.
Pointy hat to:	myself
2004-04-29 02:46:13 +00:00

41 lines
733 B
Bash

#!/bin/sh
# $FreeBSD$
# PROVIDE: smartd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD 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="NO"
smartd_flags=""
smartd_pidfile="/var/run/smartd.pid"
. %%RC_SUBR%%
name="smartd"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/smartd"
pidfile="${smartd_pidfile}"
required_files="%%PREFIX%%/etc/smartd.conf"
load_rc_config $name
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"