3 # To start fetchmail as a system service, copy this file to
4 # /etc/init.d/fetchmail and run "update-rc.d fetchmail
5 # defaults". A fetchmailrc file containg hosts and
6 # passwords for all local users should be placed in /root
7 # and should contain a line of the form "set daemon <nnn>".
9 # To remove the service, delete /etc/init.d/fetchmail and run
10 # "update-rc.d fetchmail remove".
12 DAEMON=/usr/bin/fetchmail
15 test -f $DAEMON || exit 0
19 echo -n "Starting mail retrieval agent: "
20 if start-stop-daemon --start --quiet --exec $DAEMON; then echo "fetchmail."
21 else echo "fetchmail already running."; fi
24 echo -n "Stopping mail retrieval agent: "
25 start-stop-daemon --stop --quiet --exec $DAEMON
29 echo -n "Restarting mail retrieval agent: "
30 start-stop-daemon --stop --quiet --exec $DAEMON
31 start-stop-daemon --start --quiet --exec $DAEMON
35 echo "Usage: /etc/init.d/fetchmail {start|stop|restart}"