]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - smartd_warning.sh.in
Change second dh_systemd_enable to _start
[mirror_smartmontools-debian.git] / smartd_warning.sh.in
index a077255062b6ed5c249238f7c5cf3faa0b5afd5e..81be61098d079ae37487208e591147f45b86c1c6 100644 (file)
@@ -2,7 +2,7 @@
 #
 # smartd warning script
 #
-# Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+# Copyright (C) 2012-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
 #
 # 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
@@ -12,7 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 #
-# $Id: smartd_warning.sh.in 3809 2013-04-18 19:41:40Z chrfranke $
+# $Id: smartd_warning.sh.in 3932 2014-06-29 19:02:38Z chrfranke $
 #
 
 set -e
@@ -22,12 +22,13 @@ 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=
@@ -127,7 +128,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 +179,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