Imported Debian patch 0.59.3-1
[hcoop/debian/courier-authlib.git] / debian / courier-authdaemon.init
diff --git a/debian/courier-authdaemon.init b/debian/courier-authdaemon.init
new file mode 100644 (file)
index 0000000..4c38e40
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+
+prefix="/usr"
+exec_prefix=${prefix}
+sysconfdir="/etc/courier"
+sbindir="${exec_prefix}/sbin"
+daemonscript="${sbindir}/authdaemond"
+
+. /lib/lsb/init-functions
+
+# Check for a leftover init script
+if [ ! -x $daemonscript ]; then
+       exit 0
+fi
+
+case "$1" in
+start)
+       # Start daemon.
+       cd /
+       log_daemon_msg "Starting Courier authentication services" "authdaemond"
+       $daemonscript start
+       log_end_msg 0
+       ;;
+stop)
+       # Stop daemon.
+       cd /
+       log_daemon_msg "Stopping Courier authentication services" "authdaemond"
+       $daemonscript stop
+       log_end_msg 0
+    ;;
+restart|reload|force-reload)
+       $0 stop
+       $0 start
+    ;;
+*)
+       echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+       exit 2
+       ;;
+esac
+exit 0