summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2007-01-28 15:02:47 +0000
committerPeter Volkov <pva@gentoo.org>2007-01-28 15:02:47 +0000
commit04ef4114cf22d027db040f1d84ecd2f0b43b0a0e (patch)
treefc75e683879b55e415149ba433c05f3035f21d63 /net-analyzer/honeyd/files
parentRemove old version; revision bump fo both 1.4.4 release and live Subversion e... (diff)
downloadhistorical-04ef4114cf22d027db040f1d84ecd2f0b43b0a0e.tar.gz
historical-04ef4114cf22d027db040f1d84ecd2f0b43b0a0e.tar.bz2
historical-04ef4114cf22d027db040f1d84ecd2f0b43b0a0e.zip
Fixed init script to handle multiple HONEYD_NETS. Thank Jeremy Hanmer <fzylogic AT usa.net> for report (bug #161842).
Package-Manager: portage-2.1.1-r2
Diffstat (limited to 'net-analyzer/honeyd/files')
-rw-r--r--net-analyzer/honeyd/files/honeyd.initd29
1 files changed, 17 insertions, 12 deletions
diff --git a/net-analyzer/honeyd/files/honeyd.initd b/net-analyzer/honeyd/files/honeyd.initd
index 97d21c43c957..0a6595b05817 100644
--- a/net-analyzer/honeyd/files/honeyd.initd
+++ b/net-analyzer/honeyd/files/honeyd.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/honeyd/files/honeyd.initd,v 1.2 2005/06/30 14:45:51 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/honeyd/files/honeyd.initd,v 1.3 2007/01/28 15:02:47 pva Exp $
depend() {
need net
@@ -10,7 +10,7 @@ depend() {
start() {
local options
- ebegin "Starting honeyd"
+ ebegin "Starting honeyd"
if [[ -z "${HONEYD_NET}" ]] ; then
eerror "HONEYD_NET variable must be set in /etc/conf.d/honeyd"
@@ -19,9 +19,11 @@ start() {
fi
# add route
- if ! netstat -arn | egrep "^${HONEYD_NET}[[:space:]]*127.0.0.1" ; then
- route add -net ${HONEYD_NET} gw 127.0.0.1
- fi
+ for HNET in ${HONEYD_NET} ; do
+ if ! netstat -arn | egrep "^${HNET}[[:space:]]*127.0.0.1" ; then
+ route add -net ${HNET} gw 127.0.0.1
+ fi
+ done
if [[ -n "${HONEYD_LOG}" ]] ; then
options="${options} -l ${HONEYD_LOG}"
@@ -42,15 +44,18 @@ start() {
options="${options} -i ${HONEYD_IF:-lo} ${HONEYD_OPTS}"
- start-stop-daemon --start --quiet --exec /usr/sbin/honeyd \
- -- ${options} ${HONEYD_NET} >/dev/null 2>&1
- eend $?
+ start-stop-daemon --start --quiet --exec /usr/sbin/honeyd \
+ -- ${options} ${HONEYD_NET} >/dev/null 2>&1
+ eend $?
}
stop() {
- ebegin "Stopping honeyd"
- start-stop-daemon --stop --quiet --retry 5 --exec /usr/sbin/honeyd
- route del -net ${HONEYD_NET} gw 127.0.0.1
- eend $?
+ ebegin "Stopping honeyd"
+ start-stop-daemon --stop --quiet --retry 5 --exec /usr/sbin/honeyd
+ retval=$?
+ for HNET in ${HONEYD_NET} ; do
+ route del -net ${HNET} gw 127.0.0.1
+ done
+ eend ${retval}
}