#! /bin/sh # # Title: ODIN Honeyd StartScript # # File: honeyd.start # Version: 0.2a # Date: Aug 6, 2002 # Changes: 0.2 Added tcpdump # # Written by Impriser # # Contributors: NONE # # ======================================= # Copyright (C) 2002 the Odin Project # (see 'LICENSE' for license details) # ======================================= # # USAGE: # # /sbin/init.d/honeyd start|stop|status|restart # HONEY_IP=213.144.137.85 # make sure in the config-files you use the same IP case "$1" in start) echo -n "Starting honeyd" ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. /sbin/startproc /usr/local/sbin/arpd $HONEY_IP /sbin/startproc /usr/local/bin/honeyd -d -p /etc/honeyd/nmap.prints -f /etc/honeyd/honeyd.conf $HONEY_IP/32 || return=$rc_failed /sbin/startproc /usr/sbin/tcpdump -n -e -vvv -l -s 0 -w /var/log/honeyd/tcpdump.`date +"%d%m%y"` host $HONEY_IP echo -e "$return" ;; stop) echo -n "Shutting down honeyd" ## Stop daemon with killproc(8) and if this fails ## set echo the echo return value. /sbin/killproc -TERM /usr/local/bin/honeyd || return=$rc_failed /sbin/killproc -TERM /usr/local/sbin/arpd || return=$rc_failed /sbin/killproc -TERM /usr/sbin/tcpdump || return=$rc_failed echo -e "$return" ;; restart) ## If first returns OK call the second, if first or ## second command fails, set echo return value. $0 stop && $0 start || return=$rc_failed ;; status) echo -n "Checking for honeyd: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. /sbin/checkproc /usr/local/bin/snort && echo OK || echo No process ;; *) echo "Usage: $0 {start|stop|status|restart|reload}" exit 1 ;; esac # Inform the caller not only verbosely and set an exit status. test "$return" = "$rc_done" || exit 1 exit 0