Added a Debain init script to contrib.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 28 Apr 2008 01:35:01 +0000 (03:35 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 28 Apr 2008 01:35:01 +0000 (03:35 +0200)
contrib/debian-init.d-doldacond [new file with mode: 0755]

diff --git a/contrib/debian-init.d-doldacond b/contrib/debian-init.d-doldacond
new file mode 100755 (executable)
index 0000000..caf7558
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+PATH=/usr/local/bin:/usr/local/sbin:$PATH
+
+. /lib/lsb/init-functions
+
+start() {
+    LANG=en_US.UTF-8
+    export LANG
+    log_begin_msg "Starting Dolda Connect daemon..."
+    start-stop-daemon -S -p /var/run/doldacond.pid -qx /usr/local/bin/doldacond -- -s -p /var/run/doldacond.pid
+    log_end_msg $?
+}
+
+stop() {
+    log_begin_msg "Stopping Dolda Connect daemon..."
+    start-stop-daemon -K -p /var/run/doldacond.pid -qx /usr/local/bin/doldacond
+    log_end_msg $?
+}
+
+reload() {
+    log_begin_msg "Reloading Dolda Connect daemon..."
+    start-stop-daemon -K -p /var/run/doldacond.pid -qx /usr/local/bin/doldacond -s HUP
+    log_end_msg $?
+}
+
+case "$1" in
+    start)
+       start
+       ;;
+    stop)
+       stop
+       ;;
+    reload)
+       reload
+       ;;
+    restart)
+       stop
+       start
+       ;;
+esac
+
+exit 0