aboutsummaryrefslogtreecommitdiff
path: root/local/bin/allsync
diff options
context:
space:
mode:
Diffstat (limited to 'local/bin/allsync')
-rwxr-xr-xlocal/bin/allsync18
1 files changed, 8 insertions, 10 deletions
diff --git a/local/bin/allsync b/local/bin/allsync
index b475460..3943ab4 100755
--- a/local/bin/allsync
+++ b/local/bin/allsync
@@ -1,20 +1,18 @@
#!/bin/sh
+set -eu
sec() {
echo -e '\e[1;34m==========' "$@" '==========\e[0m'
}
-
-run() {
- sec "Mail"
- mbsync -a
- ~/.local/sbin/newmail-notify
-
- sec "Calendar and contacts"
- vdirsyncer sync
+fail() {
+ echo -e '\e[1;31m---' "$@" '---' "($?)" '\e[0m'
}
+sec "Mail"
+mbsync -a
+~/.local/sbin/newmail-notify || fail "Mail synchronization reported failure"
-
-run
+sec "Calendar and contacts"
+vdirsyncer sync || "Calendar and contacts synchronization reported failure"