tbrehm
2010-04-12 0cb35d04c15e4e533dfdc98a073f76b875d64977
server/scripts/run-getmail.sh
@@ -1,9 +1,20 @@
#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
set -e
cd /etc/getmail
rcfiles=""
for file in *.conf ; do
if [ $file != "*.conf" ]; then
rcfiles="$rcfiles -r $file"
fi
done
#echo $rcfiles
exec /usr/bin/getmail -n -v -g /etc/getmail $rcfiles
if [ -f /tmp/.getmail_lock ]; then
  echo 'Found getmail lock file /tmp/.getmail_lock, we quit here.'
else
  touch /tmp/.getmail_lock
  if [ "$rcfiles" != "" ]; then
    /usr/bin/getmail -n -v -g /etc/getmail $rcfiles
  fi
  rm -f /tmp/.getmail_lock
fi