]> Pileus Git - ~andy/fetchmail/blob - contrib/debian_rc
Complete Dominik's name.
[~andy/fetchmail] / contrib / debian_rc
1 #!/bin/sh
2 #
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>".
8 #
9 # To remove the service, delete /etc/init.d/fetchmail and run
10 # "update-rc.d fetchmail remove".
11
12 DAEMON=/usr/bin/fetchmail
13
14 set -e
15 test -f $DAEMON || exit 0
16
17 case "$1" in
18   start)
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
22         ;;
23   stop)
24         echo -n "Stopping mail retrieval agent: "
25         start-stop-daemon --stop --quiet --exec $DAEMON
26         echo "fetchmail."
27         ;;
28   force-reload|restart)
29         echo -n "Restarting mail retrieval agent: "
30         start-stop-daemon --stop --quiet --exec $DAEMON
31         start-stop-daemon --start --quiet --exec $DAEMON
32         echo "fetchmail."
33         ;;
34   *)
35         echo "Usage: /etc/init.d/fetchmail {start|stop|restart}"
36         exit 1
37         ;;
38 esac
39
40 exit 0