]> Frank Brehm's Git Trees - config/bruni/etc-mint-new1.git/commitdiff
committing changes in /etc made by "/usr/bin/apt full-upgrade -y"
authorFrank Brehm <frank@brehm-online.com>
Thu, 16 Feb 2023 06:32:42 +0000 (07:32 +0100)
committerFrank Brehm <root@bruni.home.brehm-online.com>
Thu, 16 Feb 2023 06:32:42 +0000 (07:32 +0100)
Packages with configuration changes:
-zfs-zed 2.1.4-0ubuntu0.1 amd64
+zfs-zed 2.1.5-1ubuntu6~22.04.1 amd64

Package changes:
-libnvpair3linux 2.1.4-0ubuntu0.1 amd64
+libnvpair3linux 2.1.5-1ubuntu6~22.04.1 amd64
-libuutil3linux 2.1.4-0ubuntu0.1 amd64
+libuutil3linux 2.1.5-1ubuntu6~22.04.1 amd64
-libzfs4linux 2.1.4-0ubuntu0.1 amd64
+libzfs4linux 2.1.5-1ubuntu6~22.04.1 amd64
-libzpool5linux 2.1.4-0ubuntu0.1 amd64
+libzpool5linux 2.1.5-1ubuntu6~22.04.1 amd64
-zfs-zed 2.1.4-0ubuntu0.1 amd64
-zfsutils-linux 2.1.4-0ubuntu0.1 amd64
+zfs-zed 2.1.5-1ubuntu6~22.04.1 amd64
+zfsutils-linux 2.1.5-1ubuntu6~22.04.1 amd64

zfs/zed.d/zed-functions.sh
zfs/zed.d/zed.rc

index 290f9150b43f4c3270193499fe59d826ae9d324d..567f7ae3cb11b867853fbf82f3cf9dd523af2d36 100644 (file)
@@ -224,6 +224,8 @@ zed_notify()
 # ZED_EMAIL_OPTS.  This undergoes the following keyword substitutions:
 # - @ADDRESS@ is replaced with the space-delimited recipient email address(es)
 # - @SUBJECT@ is replaced with the notification subject
+#   If @SUBJECT@ was omited here, a "Subject: ..." header will be added to notification
+#
 #
 # Arguments
 #   subject: notification subject
@@ -241,7 +243,7 @@ zed_notify()
 #
 zed_notify_email()
 {
-    local subject="$1"
+    local subject="${1:-"ZED notification"}"
     local pathname="${2:-"/dev/null"}"
 
     : "${ZED_EMAIL_PROG:="mail"}"
@@ -262,12 +264,23 @@ zed_notify_email()
         return 1
     fi
 
-    ZED_EMAIL_OPTS="$(echo "${ZED_EMAIL_OPTS}" \
+    # construct cmdline options
+    ZED_EMAIL_OPTS_PARSED="$(echo "${ZED_EMAIL_OPTS}" \
         | sed   -e "s/@ADDRESS@/${ZED_EMAIL_ADDR}/g" \
                 -e "s/@SUBJECT@/${subject}/g")"
 
-    # shellcheck disable=SC2086
-    eval ${ZED_EMAIL_PROG} ${ZED_EMAIL_OPTS} < "${pathname}" >/dev/null 2>&1
+    # pipe message to email prog
+    # shellcheck disable=SC2086,SC2248
+    {
+        # no subject passed as option?
+        if [ "${ZED_EMAIL_OPTS%@SUBJECT@*}" = "${ZED_EMAIL_OPTS}" ] ; then
+            # inject subject header
+            printf "Subject: %s\n" "${subject}"
+        fi
+        # output message
+        cat "${pathname}"
+    } |
+    eval ${ZED_EMAIL_PROG} ${ZED_EMAIL_OPTS_PARSED} >/dev/null 2>&1
     rv=$?
     if [ "${rv}" -ne 0 ]; then
         zed_log_err "${ZED_EMAIL_PROG##*/} exit=${rv}"
index 672617f54a166e8d5d234dcaab6751807af2b6f1..240d0dbfa2438c487fc2da42e5bb060242a1a615 100644 (file)
@@ -30,6 +30,7 @@ ZED_EMAIL_ADDR="root"
 # The string @SUBJECT@ will be replaced with the notification subject;
 #   this should be protected with quotes to prevent word-splitting.
 # Email will only be sent if ZED_EMAIL_ADDR is defined.
+# If @SUBJECT@ was omited here, a "Subject: ..." header will be added to notification
 #
 #ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"