Fix overwrite in check_updates
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2670317bae
commit
bc01d41f1c
1 changed files with 4 additions and 2 deletions
|
@ -69,13 +69,14 @@ check_required() {
|
||||||
type mailx &> /dev/null || { echo "Requiring 'mailx' but it's not installed"; exit 1; }
|
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"
|
source_config "$HOME/.check_updates.conf" "/etc/check_updates.conf"
|
||||||
apply_defaults
|
apply_defaults
|
||||||
check_required
|
check_required
|
||||||
|
|
||||||
HOSTNAME=$(hostname)
|
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
|
if [[ "$CHECK_UPDATES_UPDATES_AMOUNT" -gt "0" ]]; then
|
||||||
SUBJECT="[updates ${HOSTNAME}]"
|
SUBJECT="[updates ${HOSTNAME}]"
|
||||||
|
@ -86,5 +87,6 @@ There are ${CHECK_UPDATES_UPDATES_AMOUNT} updates available on ${HOSTNAME}.
|
||||||
${CHECK_UPDATES_UPDATES};
|
${CHECK_UPDATES_UPDATES};
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "$MESSAGE" | mailx -Ssendwait -s "$SUBJECT" "$CHECK_UPDATES_MAIL_ADDRESS"
|
echo "$MESSAGE" | mailx -Ssendwait -s "$SUBJECT" "$CHECK_UPDATES_MAIL_ADDRESS"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue