Ver código fonte

setup some environment vars for the cron job

Some tickets suggest that the mailsync process doesn't have all environ-
ment variables set which are needed. For example:

https://github.com/LukeSmithxyz/mutt-wizard/issues/678
The error messages indicate that for mailsync, `XDG_DATA_HOME` is empty/
unset and hence it cannot resolve the user's gnupg folder.

This commit defines  those variables via the crontab,  which I think are
the relevant ones. Not sure though if these are all we need or if I for-
got some.
pull/680/head
Kr1ss 3 anos atrás
pai
commit
0b9843893f
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados ID da chave GPG: 23F078862ACFE50
1 arquivos alterados com 8 adições e 2 exclusões
  1. +8
    -2
      bin/mw

+ 8
- 2
bin/mw Ver arquivo

@@ -271,10 +271,16 @@ togglecron() { cron="$(mktemp)"
crontab -l > "$cron"
if grep -q mailsync "$cron"; then
echo "Removing automatic mailsync..."
sed -ibu /mailsync/d "$cron"; rm -f "$cron"bu
sed -ibu '/^# mailsync/,/^.*mailsync$/d' "$cron"; rm -f "$cron"bu
else
echo "Adding automatic mailsync every ${cronmin:-10} minutes..."
echo "*/${cronmin-10} * * * * $prefix/bin/mailsync" >> "$cron"
cat <<EOF >>"$cron"
MBSYNCRC=${MBSYNCRC:-$HOME/.mbsynrc}
NOTMUCH_CONFIG=${NOTMUCH_CONFIG:-$HOME/.notmuch-config}
GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg}
PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR:-$HOME/.password-store}
*/${cronmin-10} * * * * $prefix/bin/mailsync
EOF
fi &&
crontab "$cron"; rm -f "$cron" ;}



Carregando…
Cancelar
Salvar