diff options
author | Ayuso/emailAddress=pablo@netfilter.org <Ayuso/emailAddress=pablo@netfilter.org> | 2007-12-21 18:15:04 +0000 |
---|---|---|
committer | Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> | 2007-12-23 03:14:44 +0900 |
commit | 735a6fc681809beb52c160b09507aa0999fbc6ba (patch) | |
tree | 2c51319a2940076f4a71c980766f8d68ee1ee431 /doc/debian.conntrackd.init.d | |
parent | be072dced4efa3447a7c01d9f7dc90bd717fec7b (diff) | |
download | conntrack-tools-735a6fc681809beb52c160b09507aa0999fbc6ba.tar.gz conntrack-tools-735a6fc681809beb52c160b09507aa0999fbc6ba.zip |
rename `examples' directory to `doc'
Diffstat (limited to 'doc/debian.conntrackd.init.d')
-rw-r--r-- | doc/debian.conntrackd.init.d | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/debian.conntrackd.init.d b/doc/debian.conntrackd.init.d new file mode 100644 index 0000000..ba847dd --- /dev/null +++ b/doc/debian.conntrackd.init.d @@ -0,0 +1,48 @@ +#!/bin/sh +# +# /etc/init.d/conntrackd +# +# Maximilian Wilhelm <max@rfc2324.org> +# -- Mon, 06 Nov 2006 18:39:07 +0100 +# + +export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +NAME="conntrackd" +DAEMON=`command -v conntrackd` +CONFIG="/etc/conntrack/conntrackd.conf" +PIDFILE="/var/run/${NAME}.pid" + + +# Gracefully exit if there is no daemon (debian way of life) +if [ ! -x "${DAEMON}" ]; then + exit 0 +fi + +# Check for config file +if [ ! -f /etc/conntrackd/conntrackd.conf ]; then + echo "Error: There is no config file for $NAME" >&2 + exit 1; +fi + +case "$1" in + start) + echo -n "Starting $NAME: " + start-stop-daemon --start --quiet --make-pidfile --pidfile "/var/run/${NAME}.pid" --background --exec "${DAEMON}" && echo "done." || echo "FAILED!" + ;; + stop) + echo -n "Stopping $NAME:" + start-stop-daemon --stop --quiet --oknodo --pidfile "/var/run/${NAME}.pid" && echo "done." || echo "FAILED!" + ;; + + restart) + $0 start + $0 stop + ;; + + *) + echo "Usage: /etc/init.d/conntrackd {start|stop|restart}" + exit 1 +esac + +exit 0 |