summaryrefslogtreecommitdiff
path: root/dist/debian-init-script
blob: af36aadaf926a63523b6c9477e14f30c6eacd28e (plain)
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
#!/bin/sh

### BEGIN INIT INFO
# Provides:          nickserver
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: nickserver initscript
# Description:       Controls nickserver daemon (see https://github.com/leapcode/nickserver)
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=nickserver
DAEMON=`which $NAME`

# exit if the daemon doesn't exist
[ -x "$DAEMON" ] || exit 0

. /lib/init/vars.sh
. /lib/lsb/init-functions

if [ "$VERBOSE" != no ]; then
  OPTIONS="--verbose"
else
  OPTIONS=""
fi

case "$1" in
  start)
    $DAEMON $OPTIONS start
    exit $?
    ;;
  stop)
    $DAEMON $OPTIONS stop
    exit $?
    ;;
  restart)
    $DAEMON $OPTIONS restart
    exit $?
    ;;
  status)
    $DAEMON $OPTIONS status
    exit $?
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|status}"
    exit 1
esac

exit 0