Beginning Fedora 2 Tripwire Script-Page435-436
Hi All,
1st post here. Be gentle. Ok, here is what I'm after. I have Beginning Fedora 2 and in this book, there is a script for tripwire, but, it doesn't work. This is the script,
#! /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 here is the suggested command to run,
/usr/local/bin/cleanpol.pl <twpol.txt.orig \ >twpol.txt
The problem I get, is, that nothing is written to twtpol.txt, although the additions/removals are printed to the screen. Anyone see why this is so.?
Cheers.
coolboarderguy...
|