diff options
author | Bartłomiej Piotrowski <b@bpiotrowski.pl> | 2012-07-12 12:49:56 +0200 |
---|---|---|
committer | Bartłomiej Piotrowski <b@bpiotrowski.pl> | 2012-07-12 14:09:27 +0200 |
commit | 348dff0e529b2ddbaf277689747316ce697098b7 (patch) | |
tree | 8b2f985b39e12c9c5057fcdf6de8a9e2772f6008 /testing/monkey/monkey.initd | |
parent | 3fd12a0011693045356304a007f062c2f02669cd (diff) | |
download | aports-348dff0e529b2ddbaf277689747316ce697098b7.tar.bz2 aports-348dff0e529b2ddbaf277689747316ce697098b7.tar.xz |
testing/monkey: new aport
Diffstat (limited to 'testing/monkey/monkey.initd')
-rw-r--r-- | testing/monkey/monkey.initd | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/monkey/monkey.initd b/testing/monkey/monkey.initd new file mode 100644 index 000000000..7ab26aa2a --- /dev/null +++ b/testing/monkey/monkey.initd @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DAEMON="/usr/bin/monkey" +CONFFILE="/etc/monkey/monkey.conf" + +depend() { + use net +} + +start() { + ebegin "Starting monkey" + start-stop-daemon --start --exec "${DAEMON}" -- "-D" "${MONKEY_ARGS}" >/dev/null + eend $? +} + +stop() { + ebegin "Stopping monkey" + local PORT=$(awk '/^ *Port/ { print $2 }' "${CONFFILE}") + local PIDFILE=$(awk '/^ *PidFile/ { print $2 }' "${CONFFILE}") + PIDFILE="${PIDFILE}"."${PORT}" + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" + eend $? +} |