1#!/bin/sh
2#
3# $NetBSD: wdogctl,v 1.4 2009/04/21 16:08:57 joerg Exp $
4#
5
6# PROVIDE: wdogctl
7# BEFORE:  fsck_root
8
9# The watchdog is configured VERY early, so that any problems that
10# occur during the bootstrap process are protected by the watchdog.
11
12$_rc_subr_loaded . /etc/rc.subr
13
14name="wdogctl"
15rcvar=$name
16
17start_cmd="watchdog_start"
18stop_cmd="watchdog_stop"
19status_cmd="watchdog_status"
20
21extra_commands="status"
22
23watchdog_start()
24{
25	if [ x"${wdogctl_flags}" = "x" ]; then
26		warn "\${wdogctl_flags} is not set, watchdog not started"
27	else
28		echo "Starting watchdog timer."
29		/sbin/wdogctl ${wdogctl_flags}
30	fi
31}
32
33watchdog_stop()
34{
35	echo "Stopping watchdog timer."
36	/sbin/wdogctl -d
37}
38
39watchdog_status()
40{
41	/sbin/wdogctl
42}
43
44load_rc_config $name
45run_rc_command "$1"
46