File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / smartmontools / os_darwin / SMART.in
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 16:32:16 2012 UTC (12 years, 4 months ago) by misho
Branches: smartmontools, elwix, MAIN
CVS tags: v5_43, v5_42, HEAD
smartmontools

    1: #!/bin/sh
    2: 
    3: # Darwin init file for smartd
    4: #
    5: # Home page of code is: http://smartmontools.sourceforge.net
    6: #
    7: # Copyright (C) 2004-8 Geoffrey Keating <geoffk@geoffk.org>
    8: #
    9: # This program is free software; you can redistribute it and/or modify it
   10: # under the terms of the GNU General Public License as published by the Free
   11: # Software Foundation; either version 2, or (at your option) any later
   12: # version.
   13: #
   14: # You should have received a copy of the GNU General Public License (for
   15: # example COPYING); if not, write to the Free Software Foundation, Inc., 675
   16: # Mass Ave, Cambridge, MA 02139, USA.
   17: 
   18: # $Id: SMART.in,v 1.1.1.1 2012/02/21 16:32:16 misho Exp $
   19: 
   20: ##
   21: # SMART monitoring
   22: ##
   23: 
   24: . /etc/rc.common
   25: 
   26: StartService ()
   27: {
   28:     if [ "${SMARTd:=-YES-}" = "-YES-" ] &&
   29:        ! GetPID smartd > /dev/null; then
   30: 
   31:         ConsoleMessage "Starting SMART disk monitoring"
   32: 
   33:         /usr/sbin/smartd -p /var/run/smartd.pid
   34:     fi
   35: }
   36: 
   37: StopService ()
   38: {
   39:     if pid=$(GetPID smartd); then
   40:         ConsoleMessage "Stopping SMART disk monitoring"
   41:         kill -TERM "${pid}"
   42:     else
   43:         echo "smartd is not running."
   44:     fi
   45: }
   46: 
   47: RestartService ()
   48: {
   49:     if pid=$(GetPID smartd); then
   50:         kill -HUP "${pid}"
   51:     else
   52:         StartService
   53:     fi
   54: }
   55: 
   56: RunService "$1"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>