From c99591cabbd432a711c47dfdc07bf5b8603133e3 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Fri, 13 May 2016 15:21:35 +0100 Subject: [PATCH] Script for launching mutt while running mbsync --- offline_mail/.mutt/mutt_with_mbsync.sh | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 offline_mail/.mutt/mutt_with_mbsync.sh diff --git a/offline_mail/.mutt/mutt_with_mbsync.sh b/offline_mail/.mutt/mutt_with_mbsync.sh new file mode 100755 index 0000000..d243110 --- /dev/null +++ b/offline_mail/.mutt/mutt_with_mbsync.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +PID="/var/run/user/1000/sync_maiboxes.pid" + +clean_up() +{ + kill -TERM $(cat $PID) + rm $PID + exit +} + +trap clean_up SIGTERM SIGHUP SIGINT + +sync_maiboxes() +{ + while true + do + /usr/bin/mbsync -c /home/max/.mbsync/personal.mbsync -aq + /usr/bin/mbsync -c /home/max/.mbsync/personal-gmail.mbsync -aq + /usr/bin/mbsync -c /home/max/.mbsync/student.mbsync -aq + /usr/bin/mbsync -c /home/max/.mbsync/musoft.mbsync -aq + + sleep 250 + done +} + +sync_maiboxes& +echo $! > $PID +/usr/bin/mutt + +clean_up -- 2.46.2