summaryrefslogtreecommitdiff
path: root/sysutils/smartmontools-devel/files/smartd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/smartmontools-devel/files/smartd.sh')
-rw-r--r--sysutils/smartmontools-devel/files/smartd.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/sysutils/smartmontools-devel/files/smartd.sh b/sysutils/smartmontools-devel/files/smartd.sh
new file mode 100644
index 000000000000..c8f3c66d586c
--- /dev/null
+++ b/sysutils/smartmontools-devel/files/smartd.sh
@@ -0,0 +1,40 @@
+#!/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=""
+
+. %%RC_SUBR%%
+
+name="smartd"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/smartd"
+pidfile="/var/run/smartd.pid"
+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 ${smartd_pidfile} ${smartd_flags}"
+ ;;
+esac
+
+run_rc_command "$1"