chiark
/
gitweb
/
~cjwatson
/
bin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add freedesktop
[bin.git]
/
pull-mail
diff --git
a/pull-mail
b/pull-mail
index a1959505a4f34f5000b544725d255c14330d8154..13f48042249d3b8b27061e028ac3ff46ce651f66 100755
(executable)
--- a/
pull-mail
+++ b/
pull-mail
@@
-1,9
+1,13
@@
#! /bin/sh
#! /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
fi
+date >> ~/.fetchmail/log
+fetchmail >> ~/.fetchmail/log
+bsmtp-pull gluck
+
exit 0
exit 0