File: ssbd.init

package info (click to toggle)
ssbd 0.10-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 784 kB
  • ctags: 250
  • sloc: sh: 3,538; ansic: 1,817; makefile: 116; perl: 24
file content (68 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/sh
### BEGIN INIT INFO
# Provides:          ssbd
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      1
### END INIT INFO
#
# cwdaemon  A Morse daemon.
#
# Author:   Ladislav Vaiz <ok1zia@nagano.cz>
#
# Version:  @(#)cwdaemon  1.0  22-Aug-2004  ok1zia@nagano.cz
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/ssbd
NAME=ssbd
DESC="SSB daemon"

PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
OPTS=""

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
    . /etc/default/$NAME

    test -n "$UDPPORT"  && OPTS="$OPTS -p $UDPPORT"  
fi

#echo "DAEMON='$DAEMON'"
#echo "OPTS='$OPTS'"

case "$1" in
  start)
    echo -n "Starting $DESC: $NAME"
    start-stop-daemon --start --quiet --exec $DAEMON -- $OPTS
    echo "."
    ;;
  stop)
    echo -n "Stopping $DESC: $NAME"
    start-stop-daemon --stop --quiet --exec $DAEMON
    echo "."
    ;;
  restart|force-reload)
    echo -n "Restarting $DESC: $NAME"
    start-stop-daemon --stop --quiet --oknodo $PIDFILE --exec $DAEMON -- $OPTS
    sleep 1
    start-stop-daemon --start --quiet $PIDFILE --exec $DAEMON
    echo "."
    ;;
  status)
    /bin/ps xa|grep "$DAEMON" | grep -v "grep"
    ;;
  *)
    # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
    exit 1
    ;;
esac

exit 0