diff options
author | Peter Volkov <pva@gentoo.org> | 2007-01-28 15:02:47 +0000 |
---|---|---|
committer | Peter Volkov <pva@gentoo.org> | 2007-01-28 15:02:47 +0000 |
commit | 24659370dc4fa9dfd0f5ff6f064490167a909b47 (patch) | |
tree | 9aa9d1ba10a7fc447999d5a2805b526b8f4aab41 /net-analyzer/honeyd | |
parent | Remove old version; revision bump fo both 1.4.4 release and live Subversion e... (diff) | |
download | gentoo-2-24659370dc4fa9dfd0f5ff6f064490167a909b47.tar.gz gentoo-2-24659370dc4fa9dfd0f5ff6f064490167a909b47.tar.bz2 gentoo-2-24659370dc4fa9dfd0f5ff6f064490167a909b47.zip |
Fixed init script to handle multiple HONEYD_NETS. Thank Jeremy Hanmer <fzylogic AT usa.net> for report (bug #161842).
(Portage version: 2.1.1-r2)
Diffstat (limited to 'net-analyzer/honeyd')
-rw-r--r-- | net-analyzer/honeyd/ChangeLog | 8 | ||||
-rw-r--r-- | net-analyzer/honeyd/files/honeyd.initd | 29 |
2 files changed, 23 insertions, 14 deletions
diff --git a/net-analyzer/honeyd/ChangeLog b/net-analyzer/honeyd/ChangeLog index 35fd2a66613c..67ce8606e78c 100644 --- a/net-analyzer/honeyd/ChangeLog +++ b/net-analyzer/honeyd/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-analyzer/honeyd -# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/honeyd/ChangeLog,v 1.29 2006/09/07 06:54:57 pva Exp $ +# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/honeyd/ChangeLog,v 1.30 2007/01/28 15:02:46 pva Exp $ + + 28 Jan 2007; <pva@gentoo.org> files/honeyd.initd: + Fixed init script to handle multiple HONEYD_NETS. Thank Jeremy Hanmer + <fzylogic AT usa.net> for report (bug #161842). 07 Sep 2006; Peter Volkov <pva@gentoo.org> -files/honeyd-1.0-gcc4.diff, -honeyd-1.0-r1.ebuild: 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} } |