forbidhosts/files/forbidhosts.init

29 lines
529 B
Plaintext

#!/sbin/runscript
description="ForbidHosts provides SSH attack prevention"
depend()
{
use sshd
}
start() {
ebegin "Starting ForbidHosts"
source /etc/forbidhosts.conf
if [ ${BLOCK_ALL_SERVICES} -eq 1 ]; then
SERVICES="-a"
else
SERVICES=""
fi
/usr/sbin/forbidhosts -l "${SECURE_LOG}" -d "${HOSTS_DENY}" -t "${DENY_THRESHOLD}" -e "${DENY_EXPIRATION}" -p "${LOCK_FILE}" ${SERVICES}
eend $?
}
stop() {
ebegin "Stopping ForbidHosts"
source /etc/forbidhosts.conf
kill `cat ${LOCK_FILE}`
rm -f ${LOCK_FILE}
eend 0
}