vogelor
2010-05-26 24f38b424a3d12c7f4fac1829c83725b200b1e97
server/scripts/run-getmail.sh
@@ -1,4 +1,5 @@
#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
set -e
cd /etc/getmail
rcfiles=""
@@ -8,6 +9,12 @@
fi
done
#echo $rcfiles
if [ "$rcfiles" != "" ]; then
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