summaryrefslogtreecommitdiff
path: root/offlineimap-runner.sh
blob: c22e7766b636bbc797c5e63c81bc75d004213921 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
# Copyright (C) 2013-2014 Luke Shumaker <lukeshu@sbcglobal.net>

# Run offline imap, but "parse" the output to generate a sane exit status

output_file="$(mktemp --tmpdir "${0##*/}.XXXXXXXXXX")"
trap "rm -f $(printf '%q' "$output_file")" EXIT

offlineimap "$@" |& tee "$output_file"

! grep -q '^ERROR:' -- "$output_file"