chiark / gitweb /
add --prefix option; stop appending /debian/po to old-tree; check that target file...
[bin.git] / pull-mail
index a1959505a4f34f5000b544725d255c14330d8154..13f48042249d3b8b27061e028ac3ff46ce651f66 100755 (executable)
--- 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