Login   Register  
PHP Classes
elePHPant
Icontem

File: init.d/gentoo-hostblock.sh

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Rolands Kusins  >  PHP Block Host  >  init.d/gentoo-hostblock.sh  >  Download  
File: init.d/gentoo-hostblock.sh
Role: Auxiliary data
Content type: text/plain
Description: Init.d script for Gentoo
Class: PHP Block Host
Parse logs and block suspicious hosts
Author: By
Last change:
Date: 2014-01-25 01:45
Size: 806 bytes
 

Contents

Class file image Download
#!/sbin/runscript

extra_commands="stats list dlist"
description="HostBlock analyzes log files and updates access files to deny access"
description_stats="Shows statistics about blacklisted IPs"
description_list="Lists all blacklisted IPs"
description_dlist="Detailed list with all blacklisted IPs (includes count and last activity)"

depend() {
	use logger
}

start() {
	ebegin "Starting HostBlock daemon"
	start-stop-daemon --start -exec /usr/bin/hostblock --pidfile /var/run/hostblock.pid -- --daemon
	eend $?
}

stop() {
	ebegin "Stopping HostBlock daemon"
	start-stop-daemon --stop --pidfile /var/run/hostblock.pid
	eend $?
}

stats() {
	/usr/bin/hostblock --statistics
}

list() {
	/usr/bin/hostblock --list
}

dlist() {
	/usr/bin/hostblock --list --time --count
}