#!/bin/sh # # Startup script for nepenthes # # chkconfig: 2345 41 59 # description: Low-interaction honeypot # # processname: nepenthes # config: /etc/sysconfig/nepenthes ### BEGIN INIT INFO # Provides: nepenthes # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Low-interaction honeypot ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions # Get config. . /etc/sysconfig/network [ -r /etc/sysconfig/nepenthes ] && . /etc/sysconfig/nepenthes # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -x /usr/sbin/nepenthes ] || exit 0 RETVAL=0 # See how we were called. case "$1" in start) gprintf "Starting nepenthes: " daemon nepenthes --user=nepenthes --group=nepenthes -D >/dev/null 2>&1 RETVAL=$? [ $RETVAL -eq 0 ] && success || failure echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nepenthes ;; stop) gprintf "Shutting down nepenthes: " killproc nepenthes RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/nepenthes ;; status) status nepenthes RETVAL=$? ;; restart) $0 stop $0 start RETVAL=$? ;; reload) gprintf "Re-reading nepenthes config: " killproc nepenthes -HUP RETVAL=$? echo ;; *) gprintf "Usage: %s {start|stop|status|restart|reload}\n" "$0" exit 1 esac exit $RETVAL