#!/bin/sh set -eu sec() { echo -e '\e[1;34m==========' "$@" '==========\e[0m' } fail() { echo -e '\e[1;31m---' "$@" '---' "($?)" '\e[0m' } sec "Mail" mbsync -a ~/.local/sbin/newmail-notify || fail "Mail synchronization reported failure" sec "Calendar and contacts" vdirsyncer sync || "Calendar and contacts synchronization reported failure"