chiark
/
gitweb
/
~cjwatson
/
bin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ubuntu-daily: flip -a semantics to mean --authenticated, not --anonymous
[bin.git]
/
pull-mail
diff --git
a/pull-mail
b/pull-mail
index 13f48042249d3b8b27061e028ac3ff46ce651f66..96532507a75b20abd32b04e482bee520131fc7f3 100755
(executable)
--- a/
pull-mail
+++ b/
pull-mail
@@
-1,13
+1,24
@@
#! /bin/sh
#! /bin/sh
+if [ -f ~/.nomail ] && [ "$1" != --force ]; then
+ exit 0
+fi
+
loadavg="$(cut -d. -f1 /proc/loadavg)"
if [ "$loadavg" -ge 5 ]; then
# System load is too high. Don't contribute to it.
exit 0
fi
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
bsmtp-pull gluck
+hour="$(date +%H)"
+case $hour in
+ 0[0-289]|[12]*)
+ date >> ~/.fetchmail/log
+ fetchmail >> ~/.fetchmail/log
+ logrotate -s ~/.fetchmail/logrotate.status ~/.fetchmail/logrotate.conf
+ ;;
+esac
+
exit 0
exit 0