X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?p=bin.git;a=blobdiff_plain;f=pull-mail;h=13f48042249d3b8b27061e028ac3ff46ce651f66;hp=a1959505a4f34f5000b544725d255c14330d8154;hb=f93ca66f0cf1c01bac169d1e17f6c59fff959094;hpb=d4b1b0c18521d57183d981831661879bc6d60aee diff --git a/pull-mail b/pull-mail index a195950..13f4804 100755 --- a/pull-mail +++ b/pull-mail @@ -1,9 +1,13 @@ #! /bin/sh -if ! [ -e ~/.nomail ]; then - date >> ~/.fetchmail/log - fetchmail >> ~/.fetchmail/log - bsmtp-pull gluck +loadavg="$(cut -d. -f1 /proc/loadavg)" +if [ "$loadavg" -ge 5 ]; then + # System load is too high. Don't contribute to it. + exit 0 fi +date >> ~/.fetchmail/log +fetchmail >> ~/.fetchmail/log +bsmtp-pull gluck + exit 0