summaryrefslogtreecommitdiffstats
path: root/.config/offlineimap/cron
diff options
context:
space:
mode:
Diffstat (limited to '.config/offlineimap/cron')
-rwxr-xr-x.config/offlineimap/cron29
1 files changed, 15 insertions, 14 deletions
diff --git a/.config/offlineimap/cron b/.config/offlineimap/cron
index 592b2a5..635a65e 100755
--- a/.config/offlineimap/cron
+++ b/.config/offlineimap/cron
@@ -4,13 +4,13 @@ set -eu
reap_proc()
{
- local host="${1}"
+ local domn="${1}"
local user="${2}"
shift 2
local pid=
local t=0
- { read -r pid <~/".cache/offlineimap/Account-${host}-${user}.pid"; } \
+ { read -r pid <~/".cache/offlineimap/Account-${domn}-${user}.pid"; } \
2>/dev/null || return 0
while ps -p ${pid} -o cmd | grep -Fq offlineimap; do
@@ -27,8 +27,8 @@ reap_proc()
ping_srvr()
{
- local host="${1}"
- local user="${2}"
+ local user="${1}"
+ local host="${2}"
shift 2
# ping -c 1 -W 10 "${host}" || return 1
@@ -39,16 +39,17 @@ ping_srvr()
sync()
{
- local host="${1}"
+ local domn="${1}"
local user="${2}"
- shift 2
-
- reap_proc "${host}" "${user}" || return 1
- ping_srvr "${host}" "${user}" || return 1
- offlineimap -a "${host}-${user}" \
- 1>>~/".cache/offlineimap/Account-${host}-${user}.log" 2>&1 &
- printf '%d\n' ${!} >~/".cache/offlineimap/Account-${host}-${user}.pid"
+ local host="${3}"
+ shift 3
+
+ reap_proc "${domn}" "${user}" || return 1
+ ping_srvr "${user}" "${host}" || return 1
+ offlineimap -a "${domn}-${user}" \
+ 1>>~/".cache/offlineimap/Account-${domn}-${user}.log" 2>&1 &
+ printf '%d\n' ${!} >~/".cache/offlineimap/Account-${domn}-${user}.pid"
}
-#sync 'pehjota.net' 'pj' || :
-sync 'libiquity.com' 'patrick.mcdermott' || :
+#sync 'pehjota.net' 'pj' 'mail.pehjota.net' || :
+sync 'libiquity.com' 'patrick.mcdermott' 'mail.libiquity.com' || :