summaryrefslogtreecommitdiff
path: root/bin/mailsync
diff options
context:
space:
mode:
authorjw <jw@0x20.dk>2022-07-01 00:12:04 +0200
committerjw <jw@0x20.dk>2022-07-01 00:25:23 +0200
commit367c10ec3f16c3c11e1a5de980bc95dd4fa6bf79 (patch)
tree7b93d3abe62628cda16c926f069596aeb630c806 /bin/mailsync
parentef8cda91cf58be7eec314b4752a4085f4afbec3a (diff)
Silence mailsync, so cron doesn't spam e-mails on every update
Diffstat (limited to 'bin/mailsync')
-rwxr-xr-xbin/mailsync7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/mailsync b/bin/mailsync
index 2f32c14..6aba835 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -70,14 +70,13 @@ syncandnotify() {
}
# Sync accounts passed as argument or all.
-if [ "$#" -eq "0" ]; then
- accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")"
-else
+if [ "$#" -gt "0" ]; then
for arg in "$@"; do
[ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1
done
accounts=$*
fi
+[[ ! $accounts ]] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")"
# Parallelize multiple accounts
for account in $accounts; do
@@ -86,7 +85,7 @@ done
wait
-notmuch new 2>/dev/null
+notmuch new --quiet
#Create a touch file that indicates the time of the last run of mailsync
touch "$lastrun"