From bc01d41f1cc96831c51019837522ba2d3ffd4c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Sch=C3=A4ferdiek?= Date: Wed, 25 Jan 2023 23:37:53 +0100 Subject: [PATCH] Fix overwrite in check_updates --- usr/local/bin/check_updates | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/local/bin/check_updates b/usr/local/bin/check_updates index 7e99771..8c70e1b 100755 --- a/usr/local/bin/check_updates +++ b/usr/local/bin/check_updates @@ -69,13 +69,14 @@ check_required() { type mailx &> /dev/null || { echo "Requiring 'mailx' but it's not installed"; exit 1; } } +CHECK_UPDATES_UPDATES=$(eval "${CHECK_UPDATES_UPDATES_CMD}") +CHECK_UPDATES_UPDATES_AMOUNT=$(eval "${CHECK_UPDATES_UPDATES_AMOUNT_CMD}") + source_config "$HOME/.check_updates.conf" "/etc/check_updates.conf" apply_defaults check_required HOSTNAME=$(hostname) -CHECK_UPDATES_UPDATES=$(eval "${CHECK_UPDATES_UPDATES_CMD}") -CHECK_UPDATES_UPDATES_AMOUNT=$(eval "${CHECK_UPDATES_UPDATES_AMOUNT_CMD}") if [[ "$CHECK_UPDATES_UPDATES_AMOUNT" -gt "0" ]]; then SUBJECT="[updates ${HOSTNAME}]" @@ -86,5 +87,6 @@ There are ${CHECK_UPDATES_UPDATES_AMOUNT} updates available on ${HOSTNAME}. ${CHECK_UPDATES_UPDATES}; EOF ) + echo "$MESSAGE" | mailx -Ssendwait -s "$SUBJECT" "$CHECK_UPDATES_MAIL_ADDRESS" fi