aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/debian_rc
diff options
context:
space:
mode:
authorRob Funk <rfunk@funknet.net>2004-06-08 03:59:01 +0000
committerRob Funk <rfunk@funknet.net>2004-06-08 03:59:01 +0000
commitd78b61e3efaea197a6e5b2b72bf2981a9ed69461 (patch)
tree1704e13ce5d767d59868a2d5e834cb2e988ed90f /contrib/debian_rc
parentd9e84e176fe538e110d9612f9832d69846e8d3e7 (diff)
downloadfetchmail-d78b61e3efaea197a6e5b2b72bf2981a9ed69461.tar.gz
fetchmail-d78b61e3efaea197a6e5b2b72bf2981a9ed69461.tar.bz2
fetchmail-d78b61e3efaea197a6e5b2b72bf2981a9ed69461.zip
Add files from ESR's dev directory that weren't under version control
svn path=/trunk/; revision=3881
Diffstat (limited to 'contrib/debian_rc')
-rwxr-xr-xcontrib/debian_rc40
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/debian_rc b/contrib/debian_rc
new file mode 100755
index 00000000..7bbdbdc8
--- /dev/null
+++ b/contrib/debian_rc
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# To start fetchmail as a system service, copy this file to
+# /etc/init.d/fetchmail and run "update-rc.d fetchmail
+# defaults". A fetchmailrc file containg hosts and
+# passwords for all local users should be placed in /root
+# and should contain a line of the form "set daemon <nnn>".
+#
+# To remove the service, delete /etc/init.d/fetchmail and run
+# "update-rc.d fetchmail remove".
+
+DAEMON=/usr/bin/fetchmail
+
+set -e
+test -f $DAEMON || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting mail retrieval agent: "
+ if start-stop-daemon --start --quiet --exec $DAEMON; then echo "fetchmail."
+ else echo "fetchmail already running."; fi
+ ;;
+ stop)
+ echo -n "Stopping mail retrieval agent: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+ echo "fetchmail."
+ ;;
+ force-reload|restart)
+ echo -n "Restarting mail retrieval agent: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+ start-stop-daemon --start --quiet --exec $DAEMON
+ echo "fetchmail."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/fetchmail {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0