Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Tripwire Script



Hi All,

I installed tripwire on my test box(FC3) here at home. My book, 
Beginning Fedora 2 has a script that is supposed to check the content of 
twpol.txt.orig against the system and make relevant changes and create a 
new twpol.txt file. It also prints the number changes to screen. It does 
this, but, it is not creating the new file. I'll post the script and 
comand below.

#! /usr/bin/perl -w
$Additions = 0;
$Removals = 0;
while ($line = <STDIN>) {
if ( $line =~ /^\s*#\s*(\/\S+)/ ) {
if ( -e $1 ) {
$line =~ s/^\s*#//;
$Additions++;
}
} elsif ( $line =~ /^\s*(\/\S+)/ ) {
if ( ! -e $1 ) {
$line = "# " . $line;
$Removals++;
}
}
}
print STDERR "Number of additions: $Additions\n";
print STDERR "Number of removals: $Removals\n";

and the command to run it

/usr/local/bin/cleanpol.pl <twpol.txt.orig \ >twpol.txt

Hopefully someone in here can spot an error. Cheers.

Mark Sargent.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links