Pārlūkot izejas kodu

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 pirms 3 gadiem
vecāks
revīzija
0b9843893f
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 23F078862ACFE50
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. +8
    -2
      bin/mw

+ 8
- 2
bin/mw Parādīt failu

@@ -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" ;}



Notiek ielāde…
Atcelt
Saglabāt