summaryrefslogtreecommitdiff
path: root/debian/conntrackd.init
blob: 0c5ccb9a6fab0e62b9b9f5bbe7a55d7ca4508ec9 (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
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#
# conntrackd    Start conntrackd using /etc/conntrackd.conf
#
#               Written by Max Kellermann <max@duempel.org>
#
### BEGIN INIT INFO
# Provides:          conntrackd
# Required-Start:    $network $syslog $remote_fs
# Required-Stop:     $network $syslog $remote_fs
# Default-Start:     2 3 4 5 
# Default-Stop:	     0 1 6 
# Description: Starts conntrackd
# short-description: Starts conntrackd
### END INIT INFO

#includes lsb functions 
source /lib/lsb/init-functions

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/conntrackd

test -x $DAEMON || exit 0

CONFIG=/etc/conntrackd/conntrackd.conf
OPTIONS=""

test -f /etc/default/conntrackd && source /etc/default/conntrackd

test -f $CONFIG || exit 0

case "$1" in
    start)
        log_begin_msg "Starting conntrackd"
        start-stop-daemon --start --quiet \
            --exec $DAEMON \
            -- \
            -d \
            -C "$CONFIG" \
            $OPTIONS
        log_end_msg $?
        ;;
    stop)
        log_begin_msg "Stopping conntrackd"
        $DAEMON \
            -C "$CONFIG" \
            -k
        log_end_msg $?
        ;;
    restart|force-reload)
        $0 stop
        sleep 1
        $0 start
        ;;
    *)
        log_action_msg "Usage: /etc/init.d/conntrackd {start|stop|restart|force-reload}"
        exit 1
        ;;
esac

exit 0