#!/bin/sh set -eu sec() { echo -e '\e[1;34m==========' "$@" '==========\e[0m' } ecode=0 fail() { echo -e '\e[1;31m---' "$@" '---' "($?)" '\e[0m' ecode=1 } sec "Mail" mbsync -a || fail "Mail synchronization reported failure" notmuch new ~/.local/sbin/newmail-notify notmuch tag --batch --input="$HOME/.notmuch-tag-new" sec "Calendar and contacts" vdirsyncer sync || fail "Calendar and contacts synchronization reported failure" sec "Passwords" pass git pull || fail "Passwords pull failed" pass git push || fail "Passwords push failed" exit $ecode