]> git.pld-linux.org Git - packages/doldaconnect.git/commitdiff
- init script for doldaconnect
authorPaweł Gołaszewski <blues@pld-linux.org>
Thu, 7 Sep 2006 21:00:35 +0000 (21:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    doldaconnect.init -> 1.1

doldaconnect.init [new file with mode: 0755]

diff --git a/doldaconnect.init b/doldaconnect.init
new file mode 100755 (executable)
index 0000000..e1eb9ca
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh
+# $Id$
+#
+# doldacond:   Direct Connect client as daemon
+#
+#
+# chkconfig:    345 91 09
+# description:  doldacond
+#
+# config:       /etc/sysconfig/doldacond
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get service config
+if [ -f /etc/sysconfig/doldacond ]; then
+       . /etc/sysconfig/doldacond
+fi
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down doldacon
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+# See how we were called.
+case "$1" in
+       start)
+               # Check if service is already running?
+               if [ ! -f /var/lock/subsys/doldacond ]; then
+                       msg_starting doldacond
+                       daemon doldacond -p /var/run/doldacond.pid ${ADD_OPT}
+                       RETVAL=$?
+                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/doldacond
+               else
+                       msg_already_running doldacond
+               fi
+               ;;
+       stop)
+               if [ -f /var/lock/subsys/doldacond ]; then
+                       msg_stopping doldacond
+                       killproc doldacond --pidfile /var/run/doldacond.pid
+                       rm -f /var/lock/subsys/doldacond
+               else
+                       msg_not_running doldacond
+               fi
+               ;;
+       status)
+               status doldacond
+               RESULT=$?
+               ;;
+       reload)
+               if [ -f /var/lock/subsys/doldacond ]; then
+                       msg_reloading doldacond
+                       killproc doldacond -HUP
+                       RETVAL=$?
+               else
+                       msg_not_running doldacond >&2
+                       exit 7
+               fi
+               ;;
+       restart|force-reload)
+               $0 stop
+               $0 start
+               ;;
+       *)
+               msg_usage "$0 {start|stop|restart|force-reload|status}"
+               exit 3
+esac
+
+exit 0
This page took 0.107812 seconds and 4 git commands to generate.