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