A sample script is placed at
/usr/share/doc/packages/fetchmail/README.SuSE
If you want to fetch mail periodically, you can start fetchmail as a daemon
using the following init script:
#! /bin/sh
# Copyright (c) 1996-2000 SuSE GmbH Nuremberg, Germany. All rights reserved.
#
# Authors: Klaus Franken
# Björn Jacke
#
# /etc/init.d/fetchmail
#
# please edit /etc/fetchmailrc
#
### BEGIN INIT INFO
# Provides: fetchmail
# Required-Start: network
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop:
# Description: run fetchmail in daemon mode
### END INIT INFO
. /etc/rc.config
return=$rc_done
case "$1" in
start)
echo -n "Starting fetchmail-daemon"
/usr/bin/fetchmail -d 900 -a -f /root/.fetchmailrc -L /var/log/fetchmail 2>&1 || return=$rc_failed
echo -e "$return"
;;
stop)
echo -n "Shutting down fetchmail-daemon"
/usr/bin/fetchmail -quit || return=$rc_failed
echo -e "$return"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
The file to which the -f option points must be the .fetchmailrc of
the user who has to fetch the mail. Put the script in /etc/init.d/ and make it executable:
cd /etc/init.d/
chmod +x fetchmail
and finally run insserv. |