diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-06-30 13:45:31 +0200 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-06-30 13:45:31 +0200 |
| commit | b244546935672b604ab9e46bbb4284638dbef509 (patch) | |
| tree | b9ecc30dbd6d681745a4e9f2c713789425809c3d /shell-scripts/mailsync | |
| parent | 702cdf6d41bc2bcd3fdad00ba49bb19f7fd36fb6 (diff) | |
stuff
Diffstat (limited to 'shell-scripts/mailsync')
| -rw-r--r-- | shell-scripts/mailsync | 16 |
1 files changed, 8 insertions, 8 deletions
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 |
