| 1 |
#!/sbin/runscript |
| 2 |
# Copyright 1999-2012 Gentoo Foundation |
| 3 |
# Distributed under the terms of the GNU General Public License v2 |
| 4 |
# $Header: /var/cvsroot/gentoo-x86/www-servers/monkeyd/files/monkeyd.init.d,v 1.3 2005/02/20 22:47:11 vapier Exp $ |
| 5 |
|
| 6 |
DAEMON="/usr/bin/monkey" |
| 7 |
CONFFILE="/etc/monkeyd/monkey.conf" |
| 8 |
|
| 9 |
depend() { |
| 10 |
use net |
| 11 |
} |
| 12 |
|
| 13 |
start() { |
| 14 |
ebegin "Starting monkeyd" |
| 15 |
start-stop-daemon --start --exec "${DAEMON}" -- "-D" "${MONKEY_ARGS}" >/dev/null |
| 16 |
eend $? |
| 17 |
} |
| 18 |
|
| 19 |
stop() { |
| 20 |
ebegin "Stopping monkeyd" |
| 21 |
local PORT=$(awk '/^ *Port/ { print $2 }' "${CONFFILE}") |
| 22 |
local PIDFILE=$(awk '/^ *PidFile/ { print $2 }' "${CONFFILE}") |
| 23 |
PIDFILE="${PIDFILE}"."${PORT}" |
| 24 |
start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" |
| 25 |
eend $? |
| 26 |
} |