From 5a3cdc998d4415ccd616380727cc6549da86c907 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 3 Apr 2007 16:18:36 +0000 Subject: [PATCH 1/1] bail out if system load is >= 5 --- pull-mail | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pull-mail b/pull-mail index 828ec37..13f4804 100755 --- a/pull-mail +++ b/pull-mail @@ -1,5 +1,11 @@ #! /bin/sh +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 -- 2.30.2