Thread: IP blocker
View Single Post
Old May 24th, 2006, 10:39 AM   #9
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
hey,

just made a rc script for gentoo to run the perl script:

#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        before sshd
}

start() {
        start-stop-daemon --start --background --pidfile /var/run/monitor.pid --make-pidfile --exec /usr/scripts/monitor.pl
        eend $?
}

stop() {
        ebegin "Stopping IP Blocker"
        start-stop-daemon --stop --pidfile /var/run/monitor.pid --name /usr/scripts/monitor.pl
        eend $?
}

It should be noted, that this rc script will probably only work on gentoo systems. i still haven't got the stop feature working corectly, but it does start the script at boot once you've added the rc script to a run level (you should add it to the default run level).
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote