From 8d0150f686ed0c03f6ec2a224277a3afa15b4213 Mon Sep 17 00:00:00 2001 From: Willy Sudiarto Raharjo Date: Sun, 16 Dec 2012 22:16:20 +0100 Subject: network/sshblock: Added (an SSH dictionary-attack blocker). Signed-off-by: Matteo Bernardini --- network/sshblock/doinst.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 network/sshblock/doinst.sh (limited to 'network/sshblock/doinst.sh') diff --git a/network/sshblock/doinst.sh b/network/sshblock/doinst.sh new file mode 100644 index 000000000000..74db18c0e3c9 --- /dev/null +++ b/network/sshblock/doinst.sh @@ -0,0 +1,14 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/rc.d/rc.sshblock.new -- cgit v1.2.3