Actually instead of exporting the banned IP addresses every 60 seconds and writing them to a file, I ended up reading fail2ban log files to find which IP's were banned.
The actual issue that I am trying to solve, is that the current version of FreePBX can only run fail2ban v0.8.14, which does not maintain it's list of banned IP addresses after a reboot. So I wanted to somehow save the list of banned IP's, and after reboot, manually ban them again. Something like this:
Which again is not really working 100%, so now I'm thinking of using iptables commands to ban the IP's, not fail2ban commands.
But I appreciate your suggestions and the discussion. It helps with the learning.
Hi Gurus,
I had a question regarding avoiding duplicates.i have a file abc.txt
abc.txt
-------
READER_1_1_1> HIER_28056 XML Reader: Error occurred while parsing:; line number ; column number
READER_1_3_1> Sun Mar 23 23:52:48 2008
READER_1_3_1> HIER_28056 XML Reader: Error occurred while... (7 Replies)
Hi all.
I want to check the free space on a given FS and process the output. Right now, I'm using a temp file to avoid using df twice. This is what I'm doing
#!/usr/bin/ksh
...
df -k $FS_NAME > $TMP_FILE 2>&1
if ]; then
RESULT="CRITICAL - $(cat $TMP_FILE)"
else
cat $TMP_FILE | ...... (3 Replies)
Good afternoon.
I am a newbie.
We just had a potentially big problem (negated to having good backups).
Basically, there is an option in SAM, to delete all the data from the system that a user ever created.
Lo and behold, silly me, I choose that option, and all sorts of needed files... (5 Replies)
Guys
following lines help me in getting numbers from PID column ,to be thrown into first column of a CSV file.
COLUMNS=2047 /usr/bin/ps -eo pid,ppid,uid,user,args | grep -v "PID" > /tmp/masterPID.txt
cat /tmp/masterPID.txt|while read line
do
PID=`echo $line|awk '{print $1}'`
echo "$PID"... (4 Replies)
Hi Everyone,
# cat a.txt
94,aqqc,62345907,
5,aeec,77,
# cat 1.pl
#!/usr/bin/perl
use strict;
use warnings;
use Date::Manip;
open(my $FA, "/root/a.txt") or die "$!";
while(<$FA>) {
chomp;
my @tmp=split(/\,/, $_);
if (index($tmp, "qq") ne -1) {
... (4 Replies)
Hi alll
I have a file with following kind input
I want in output duplicates should not be there but there should be numbering mentioned before that like (4 Replies)
Hi all
I have a file with following input
It contains 5 columns
gene name drug drug ID disease approved
Now the same gene is repeated many times with different data in column2,3 ,4,5
I want to arrange dat in such a way that there shuld be one entry in the column(no... (2 Replies)
Hello,
I am trying to run some code on Matlab over ssh . The code takes around 5-6 hours to complete. so after giving the command to run it , I locked my machine and then went off to sleep at night, only to discover in the morning that I get this message :
...Code running, partial results... (1 Reply)
Hello,
I have been working on script in which search and replace the multiple pattern.
1. update_params.sh read the multiple pattern from input file ParamMapping.txt(old_entry|New_entry) and passing this values one by one to change_text.sh
2. change_text.sh read... (0 Replies)
Discussion started by: ketanraut
0 Replies
LEARN ABOUT DEBIAN
lbdb-fetchaddr
LBDB-FETCHADDR(1) User Manuals LBDB-FETCHADDR(1)NAME
lbdb-fetchaddr - grab addresses from mails add append them to lbdb database
SYNOPSIS
lbdb-fetchaddr [-d dateformat] [-x headerfieldlist] [-c charset] [-a]
lbdb-fetchaddr [-v|-h]
DESCRIPTION
lbdb-fetchaddr is a shell script which reads a mail on stdin. It extracts the contents of some header fields (default: `From:', `To:',
`Cc:', `Resent-From:', and `Resent-To:') from the mail header (only addresses with a real name) and appends them to
$HOME/.lbdb/m_inmail.list. For performance issues lbdb-fetchaddr appends new addresses to this file without removing duplicates. To get
rid of duplicates, the program lbdb-munge exists, which is run by m_inmail if needed and removes duplicates.
To use this program, put the following lines into your $HOME/.procmailrc:
:0hc
| lbdb-fetchaddr
lbdb-fetchaddr writes the actual date to the third column of the database by using strftime(3). It uses "%Y-%m-%d %H:%M" as the default
date format (e.g. "1999-04-29 14:33"). You can change this by using the -d option to select a different date format string as parameter of
lbdb-fetchaddr command like
:0hc
| lbdb-fetchaddr -d "%y-%m-%d"
which results in e.g. "99-04-29".
OPTIONS -v Print version number of lbdb-fetchaddr.
-h Print short help of lbdb-fetchaddr.
-d dateformat
Use the given date format using strftime(3) syntax.
-x headerfields
A colon separated list of header fields, which should be searched for mail addresses. If this option isn't given, we fall back to
`from:to:cc:resent-from:resent-to'.
-c charset
The charset which will be used to write the database. This should be the charset which the application expects (normally the one
from your current locale). If this option isn't given, we fall back to `iso-8859-15'.
-a Also grab addresses without a real name. Use the local part of the mail address as real name.
FILES
$HOME/.lbdb/m_inmail.list
/usr/lib/lbdb/fetchaddr
/usr/lib/lbdb/m_inmail
SEE ALSO lbdbq(1), lbdb_dotlock(1), procmail(1), procmailrc(5), strftime(3).
CREDITS
Most of the really interesting code of this program (namely, the RFC 822 address parser used by lbdb-fetchaddr) was stolen from Michael
Elkins' mutt mail user agent. Additional credits go to Brandon Long for putting the query functionality into mutt.
AUTHOR
The lbdb package was written by Thomas Roessler <roessler@guug.de> and is now maintained and extended by Roland Rosenfeld <roland@spin-
naker.de>.
Unix October 2005 LBDB-FETCHADDR(1)