projects
/
fail2ban-cn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- vise informativnih poruka
[fail2ban-cn.git]
/
debian
/
postinst
diff --git
a/debian/postinst
b/debian/postinst
index
19a2436
..
86f1150
100755
(executable)
--- a/
debian/postinst
+++ b/
debian/postinst
@@
-34,11
+34,13
@@
CONF=/etc/fail2ban/jail.conf
if [ -e "$CONF" ]; then
# enable ssh, pam-generic, sasl, proftpd and vsftpd service
if [ -e "$CONF" ]; then
# enable ssh, pam-generic, sasl, proftpd and vsftpd service
- perl -ne 'if (/\[(ssh|pam-generic|sasl|proftpd|vsftpd)\]/ .. /enabled/) { $_ =~ s/enabled = false/enabled = true/gi }; print $_' "$CONF" > "$CONF.$$" && \
+ echo "CN: Enabling SSH, PAM-generic, SASL, Proftpd and Vsftpd support"
+ perl -ne 'if (/^\[(ssh|pam-generic|sasl|proftpd|vsftpd)\]/ .. /^enabled/) { $_ =~ s/^enabled\s+=\s+false/enabled = true/gi }; print $_' "$CONF" > "$CONF.$$" && \
cp_mv "$CONF.$$" "$CONF"
rm -f "$CONF.$$"
# enable dovecot service
cp_mv "$CONF.$$" "$CONF"
rm -f "$CONF.$$"
# enable dovecot service
+ echo "CN: Enabling full Dovecot support"
cp -a "$CONF" "$CONF.$$"
cp-update fail2ban-cn "$CONF.$$" <<EOF
[dovecot]
cp -a "$CONF" "$CONF.$$"
cp-update fail2ban-cn "$CONF.$$" <<EOF
[dovecot]
@@
-56,6
+58,7
@@
EOF
NETADDR="$RET"
IGNOREIP=$(grep '^ignoreip' "$CONF")
if ! echo "$IGNOREIP" | grep -q "$NETADDR"; then
NETADDR="$RET"
IGNOREIP=$(grep '^ignoreip' "$CONF")
if ! echo "$IGNOREIP" | grep -q "$NETADDR"; then
+ echo "CN: Enabling local IP ranges exclusion"
cp_check_and_sed '^ignoreip' \
"s;^\(ignoreip.*\)$;\1 $NETADDR;g" "$CONF" || true
fi
cp_check_and_sed '^ignoreip' \
"s;^\(ignoreip.*\)$;\1 $NETADDR;g" "$CONF" || true
fi