OK, Ive began a md5 file tracker, its a basic shell script that runs through "/" by default md5suming every file in its wake and storing them in the db which defaults to /etc/md5.db.
[root@pc-agr root]# pacsec
Usage: pacsec [-f /path/to/md5.db] [-p /path/to/check/from] [-g|-c]
you can simply run:
to generate the db, and to use that same db to check the fs do:
more advanced options are i.e.
pacsec -f /mnt/floppy/md5.db -p /home/ody -g
would generate a md5.db of my home dir and stick it on a floppy for me (aslong as its mounted offcourse)
hrmm thats it for now.. theres more u can do with it that just that, but Ill let you figure it out for now.. please send any suggestions, flames, hugs etc.. my way.
oh u can get the shell script from: http://www.netrux.com/pacsec
hrmm just noticed its having an awful time with spaced filenames i.e. "im a tit that likes to put spaces in file names.txt"
neone know a good way round this? if not no worries Ill be recoding everything in C soon neway(woohoo file descripters).
put quotes around the file and path variables
Thats wont work.. because:
for file in `find $path -type f`
will run though each part of the file name with spaces thinking its a different field to pull back.. is there any way of telling the for loop to just pull lines?
find $path -type f | while read file
I get a "command substitution: line 2: syntax error: unexpected end of file"
for file in `find $path -type f | while read file`
even though the bash script seems to work.. it dies not long after running.. so Im starting again on home ground with C and an md5 implementation... means getting my head round threads but I think Ive got that sussed.. ne good socket coders about?
it realy dies the werd stuff is this
please wait, generating md5.db...
md5sum: /proc/sys/net/ipv4/route/flush: Invalid argument
-----BEGIN GEEK CODE BLOCK-----
GU/ d- s: a- C L U P+ L+++ E--- W+
N 0+ K- W-- !O !M V-- PS+ PE- V++ PGP T 5 Z+ R* TV+ B+
DI-- D- G-- e-- h! r++ z+ z*
------END GEEK CODE BLOCK------