Re: [Integrit-users] Script to roll back filesystem changes as reported by integrit?
Brought to you by:
ecashin
From: Antoine <abo...@ya...> - 2005-04-23 13:40:45
|
Thanks for the code. I'm not very familiar with sed so I rewrote it in perl as below. This one is tested and works. :) #!/usr/bin/perl while( <STDIN> ) { next unless s/^changed: (.*) //; $filename = $1; while( /([a-z])\(([\d-]+):([\d-]+)\)/g ) { $1 eq "u" and run( "chown $2 $filename" ); $1 eq "g" and run( "chgrp $2 $filename" ); } } sub run { print( "$_[0]\n" ); system( "$_[0]" ) and die "command failed"; } --- "Ed L. Cashin" <ec...@gm...> wrote: > It does sound like something that could be > scripted with a little sed. I don't usually post > untested scripts, but this is just to convey a > general approach ... __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |