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