Lines 1-44
Link Here
|
1 |
#!/bin/sh |
|
|
2 |
# $FreeBSD: ports/sysutils/smartmontools/files/smartd.in,v 1.2 2010/03/27 00:15:05 dougb Exp $ |
3 |
|
4 |
# PROVIDE: smartd |
5 |
# REQUIRE: DAEMON |
6 |
# BEFORE: LOGIN |
7 |
# KEYWORD: shutdown |
8 |
|
9 |
# Define these smartd_* variables in one of these files: |
10 |
# /etc/rc.conf |
11 |
# /etc/rc.conf.local |
12 |
# /etc/rc.conf.d/smartd |
13 |
# |
14 |
# DO NOT CHANGE THESE DEFAULT VALUES HERE |
15 |
# |
16 |
smartd_enable="${smartd_enable-NO}" |
17 |
smartd_pidfile="/var/run/smartd.pid" |
18 |
|
19 |
. /etc/rc.subr |
20 |
|
21 |
name="smartd" |
22 |
rcvar=`set_rcvar` |
23 |
command="%%PREFIX%%/sbin/smartd" |
24 |
|
25 |
load_rc_config $name |
26 |
|
27 |
: ${smartd_config="%%PREFIX%%/etc/smartd.conf"} |
28 |
: ${smartd_flags="-c ${smartd_config}"} |
29 |
|
30 |
pidfile="${smartd_pidfile}" |
31 |
required_files="${smartd_config}" |
32 |
|
33 |
case "${smartd_flags}" in |
34 |
*-p\ *) |
35 |
echo "ERROR: \$smartd_flags includes -p option." \ |
36 |
"Please use \$smartd_pidfile instead." |
37 |
exit 1 |
38 |
;; |
39 |
*) |
40 |
smartd_flags="-p ${pidfile} ${smartd_flags}" |
41 |
;; |
42 |
esac |
43 |
|
44 |
run_rc_command "$1" |