#!/bin/bash source "$HOME/work/scripts/toso-utils.sh" mailboxes="" function set_mailboxes() { t_sec=`date "+%s"` t_min=$(($t_sec / 60)) t_min=$(($t_min % 10)) index=$(($t_min / 2)) odd=$(($t_min % 2)) redhat="" # update once every two minutes if [ $odd -eq 1 ]; then return $bashfalse fi if on_redhat_vpn; then redhat="redhat"; fi case $index in 0) mailboxes="bugzilla redhat" ;; 1) mailboxes="victortoso" ;; 2) mailboxes="spam redhat" ;; 3) mailboxes="lists" ;; esac return $bashtrue } set_mailboxes && mbsync $mailboxes