From 77a64169b5b70a2cef6a2718b5828645ae64a308 Mon Sep 17 00:00:00 2001 From: Andrew Stowell Date: Thu, 3 Jul 2025 13:24:01 -0400 Subject: [PATCH] storage-alert updated to only messaging when limits are reached. --- crons/storage-alert.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crons/storage-alert.sh b/crons/storage-alert.sh index 6f69a99..e16fbba 100755 --- a/crons/storage-alert.sh +++ b/crons/storage-alert.sh @@ -27,11 +27,18 @@ for index in "${!STORAGE_ALERT[@]}"; do fi done -title='Storage Update' if [[ "${warn}" = true ]]; then - purple='purple' + color='purple' title='Storage Alert' + touch "${HOME}/.storage.alert" +elif [[ -f "${HOME}/.storage.alert" ]]; then + color='blue' + title='Storage Alert Resolved' + rm "${HOME}/.storage.alert" +else + # no storage alerts, exit quietly + exit 0 fi -printf "%s\n" "${messages[@]}" | "${scriptRoot}/discord.sh" -c "${purple-blue}" -d 'Storage Alert' -t "${title}" +printf "%s\n" "${messages[@]}" | "${scriptRoot}/discord.sh" -c "${color}" -t "${title}"