File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / smartmontools / os_darwin / SMART.in
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:17:36 2013 UTC (10 years, 11 months ago) by misho
Branches: smartmontools, elwix, MAIN
CVS tags: v6_2, v6_1p0, v6_1, HEAD
6.1

    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.,
   16: # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   17: 
   18: # $Id: SMART.in,v 1.1.1.2 2013/07/22 01:17:36 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>