]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - smartd_warning.sh.in
import smartmontools 7.0
[mirror_smartmontools-debian.git] / smartd_warning.sh.in
index a077255062b6ed5c249238f7c5cf3faa0b5afd5e..1cc268357caf0b291f0f0cff1eefe1b870e31095 100644 (file)
@@ -2,32 +2,30 @@
 #
 # smartd warning script
 #
-# Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+# Home page of code is: http://www.smartmontools.org
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# Copyright (C) 2012-16 Christian Franke
 #
-# You should have received a copy of the GNU General Public License
-# (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
-# $Id: smartd_warning.sh.in 3809 2013-04-18 19:41:40Z chrfranke $
+# $Id: smartd_warning.sh.in 4839 2018-11-27 18:26:08Z chrfranke $
 #
 
 set -e
 
 # Set by config.status
+@ENABLE_SCRIPTPATH_TRUE@export PATH="@scriptpath@"
 PACKAGE="@PACKAGE@"
 VERSION="@VERSION@"
 prefix="@prefix@"
 sysconfdir="@sysconfdir@"
+smartdscriptdir="@smartdscriptdir@"
 
 # Default mailer
 os_mailer="@os_mailer@"
 
-# Plugin directory
-plugindir="$sysconfdir/smartd_warning.d"
+# Plugin directory (disabled if empty)
+plugindir="@smartdplugindir@"
 
 # Parse options
 dryrun=
@@ -41,7 +39,7 @@ smartd $VERSION warning message script
 
 Usage:
   export SMARTD_MAILER='Path to external script, empty for "$os_mailer"'
-  export SMARTD_ADDRESS='Space separated mail adresses, empty if none'
+  export SMARTD_ADDRESS='Space separated mail addresses, empty if none'
   export SMARTD_MESSAGE='Error Message'
   export SMARTD_FAILTYPE='Type of failure, "EMailTest" for tests'
   export SMARTD_TFIRST='Date of first message sent, empty if none'
@@ -127,7 +125,8 @@ export SMARTD_FULLMESSAGE="$fullmessage
 "
 
 # Run plugin scripts if requested
-case " $SMARTD_ADDRESS" in
+if test -n "$plugindir"; then
+ case " $SMARTD_ADDRESS" in
   *\ @*)
     if [ -n "$dryrun" ]; then
       echo "export SMARTD_SUBJECT='$SMARTD_SUBJECT'"
@@ -177,7 +176,8 @@ case " $SMARTD_ADDRESS" in
     # Send email to remaining addresses
     test -n "$SMARTD_ADDRESS" || exit 0
     ;;
-esac
+ esac
+fi
 
 # Send mail or run command
 if [ -n "$SMARTD_ADDRESS" ]; then