diff options
Diffstat (limited to 'debian/conntrackd.init')
-rw-r--r-- | debian/conntrackd.init | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/debian/conntrackd.init b/debian/conntrackd.init new file mode 100644 index 0000000..0c5ccb9 --- /dev/null +++ b/debian/conntrackd.init @@ -0,0 +1,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 |