(no title)
stonewareslord | 3 years ago
ntfy done sleep 10
If you want to also capture output, you can just use a simple bash function: ntfy_done_output() {
local TEMP_FILE="$(mktemp)" SUCCESS LOG
"${@}" 2>&1 | tee "${TEMP_FILE}"
SUCCESS="$((!PIPESTATUS[0]))"
LOG="$(curl -fLX POST -T- <"${TEMP_FILE}" some-pastebin.example.com)"
if ((SUCCESS)); then
ntfy send "Success! Log: ${LOG}"
else
ntfy send "Failed :(. Log: ${LOG}"
fi
}
No comments yet.