#!/usr/bin/env bash # usage usage() { USAGE=$( cat < /dev/null || { echo "Requiring 'hostname' but it's not installed"; exit 1; } type mailx &> /dev/null || { echo "Requiring 'mailx' but it's not installed"; exit 1; } } source_config "$1" "$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}]" MESSAGE=$( cat <