#
# 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=
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'
"
# 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'"
# Send email to remaining addresses
test -n "$SMARTD_ADDRESS" || exit 0
;;
-esac
+ esac
+fi
# Send mail or run command
if [ -n "$SMARTD_ADDRESS" ]; then