- add RC support

- use USE_DOS2UNIX

PR:		ports/110842
Submitted by:	Brad Huntting <huntting_AT_glarp dot com>
Reviewed by:	clsung
This commit is contained in:
Cheng-Lung Sung 2007-04-02 01:11:38 +00:00
parent 9c705360b8
commit 78bee6fab2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=188969
3 changed files with 49 additions and 20 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= blocksshd
PORTVERSION= 1.0.1
PORTREVISION= 1
CATEGORIES= security sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= blocksshd
@ -21,11 +22,15 @@ RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Net/DNS/Resolver.pm:${PORTSDIR}/dns/p5-Ne
MAKE_ARGS= PREFIX="${PREFIX}" SYSCONFDIR="${PREFIX}/etc"
NO_BUILD= yes
USE_PERL5_RUN= yes
USE_RC_SUBR= blocksshd
USE_DOS2UNIX= blocksshd blocksshd.conf
MAN1= blocksshd.1
post-patch:
post-extract:
@${CHMOD} 755 ${WRKSRC}/init
post-patch:
@${REINPLACE_CMD} -e 's|^MANCOMPRESS = .gz||g' ${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's|/etc/blocksshd.conf|${PREFIX}/etc/blocksshd.conf|g' ${WRKSRC}/blocksshd

View file

@ -0,0 +1,24 @@
#!/bin/sh
#
# PROVIDE: blocksshd
# REQUIRE: NETWORKING
# BEFORE: securelevel
# KEYWORD: shutdown
. %%RC_SUBR%%
name="blocksshd"
rcvar="`set_rcvar`"
command="%%PREFIX%%/bin/${name}"
command_interpreter="/usr/bin/perl"
pidfile="/var/run/${name}.pid"
blocksshd_flags="--start"
stop_precmd=blocksshd_stop
blocksshd_stop () {
${command} --stop
}
load_rc_config $name
run_rc_command "$1"

View file

@ -1,23 +1,23 @@
--- blocksshd.conf.orig Mon Nov 20 05:36:42 2006
+++ blocksshd.conf Thu Nov 23 13:12:35 2006
@@ -1,9 +1,9 @@
# vim: syntax=perl
$cfg = {
- os => 'linux', # Target OS - either linux or bsd
+ os => 'bsd', # Target OS - either linux or bsd
chain => 'blocksshd', # Name of iptables or pf chain
- logfile => '/var/log/secure', # Log file to monitor
+ logfile => '/var/log/auth.log', # Log file to monitor
logcheck => '10', # How often to check the log file
max_attempts => '4', # Max number of failures
timeout => '360', # Reset IP count if no activity after time out in seconds
# vim: syntax=perl
$cfg = {
- os => 'linux', # Target OS - either linux or bsd
+ os => 'bsd', # Target OS - either linux or bsd
chain => 'blocksshd', # Name of iptables or pf chain
- logfile => '/var/log/secure', # Log file to monitor
+ logfile => '/var/log/auth.log', # Log file to monitor
logcheck => '10', # How often to check the log file
max_attempts => '4', # Max number of failures
timeout => '360', # Reset IP count if no activity after time out in seconds
@@ -14,7 +14,7 @@
pid_file => '/var/run/blocksshd.pid', # Location of PID file
send_email => '1', # Enable the sending of email notifications
email => 'root', # Email address to send notifications
- mail => '/bin/mail', # Location of mail binary
+ mail => '/usr/bin/mail', # Location of mail binary
iptables => '/sbin/iptables', # Location of iptables binary - only for Linux
pfctl => '/sbin/pfctl', # Location of pfctl binary - only for BSD
whitelist => [qw{
pid_file => '/var/run/blocksshd.pid', # Location of PID file
send_email => '1', # Enable the sending of email notifications
email => 'root', # Email address to send notifications
- mail => '/bin/mail', # Location of mail binary
+ mail => '/usr/bin/mail', # Location of mail binary
iptables => '/sbin/iptables', # Location of iptables binary - only for Linux
pfctl => '/sbin/pfctl', # Location of pfctl binary - only for BSD
whitelist => [qw{