From b244546935672b604ab9e46bbb4284638dbef509 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Fri, 30 Jun 2023 13:45:31 +0200 Subject: stuff --- shell-scripts/mailsync | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'shell-scripts/mailsync') diff --git a/shell-scripts/mailsync b/shell-scripts/mailsync index 52d1fff..426e5b7 100644 --- a/shell-scripts/mailsync +++ b/shell-scripts/mailsync @@ -83,23 +83,23 @@ syncandnotify() { esac } -allchannels="$(grep -hs "Channel" "$MBSYNCRC" "$MPOPRC" | sort -u)" +allgroups="$(grep -hs "Group" "$MBSYNCRC" "$MPOPRC" | sort -u)" # Get accounts to sync. All if no argument. Prefix with `error` if non-existent. IFS=' ' if [ -z "$1" ]; then - tosync="$allchannels" + tosync="$allgroups" else - tosync="$(for arg in "$@"; do for availacc in $allchannels; do - [ "$arg" = "${availacc##* }" ] && echo "$availacc" && break + tosync="$(for arg in "$@"; do for grp in $allgroups; do + [ "$arg" = "${grp##* }" ] && echo "$grp" && break done || echo "error $arg"; done)" fi -for channel in $tosync; do - case $channel in - Channel*) syncandnotify imap "${channel##* }" & ;; - account*) syncandnotify pop "${channel##* }" & ;; +for grp in $tosync; do + case $grp in + Group*) syncandnotify imap "${grp##* }" & ;; + account*) syncandnotify pop "${grp##* }" & ;; error*) echo "ERROR: Account ${channelt##* } not found." ;; esac done -- cgit v1.2.3