ntfy done sleep 10
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 }