You are not logged in.

#1 2003-02-04 09:58:35

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

md5 tracker

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.

Basic usage:

[root@pc-agr root]# pacsec
Usage: pacsec [-f /path/to/md5.db] [-p /path/to/check/from] [-g|-c]
[root@pc-agr root]#

you can simply run:

pacsec -g

to generate the db, and to use that same db to check the fs do:

pacsec -c

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

peace!

Offline

#2 2003-02-04 10:05:37

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Re: md5 tracker

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).

Offline

#3 2003-02-04 11:49:08

jk
Member
From: Groningen, The Netherlands
Registered: 2002-10-24
Posts: 66
Website

Re: md5 tracker

put quotes around the file and path variables

Offline

#4 2003-02-04 11:56:37

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Re: md5 tracker

Thats wont work.. because:

     for file in `find $path -type f`
      do

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?

Offline

#5 2003-02-04 12:02:38

jk
Member
From: Groningen, The Netherlands
Registered: 2002-10-24
Posts: 66
Website

Re: md5 tracker

ah...heh :-)

find $path -type f | while read file
do
      .............
done

Offline

#6 2003-02-04 12:07:13

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Re: md5 tracker

I get a "command substitution: line 2: syntax error: unexpected end of file"
"
     for file in `find $path -type f | while read file`
      do
"

with that hmm

Offline

#7 2003-02-05 11:50:36

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Re: md5 tracker

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?

Offline

#8 2003-02-10 03:10:50

jlvsimoes
Member
From: portugal
Registered: 2002-12-23
Posts: 392
Website

Re: md5 tracker

it realy dies the werd stuff is this
pacsec -g
please wait, generating md5.db...
md5sum: /proc/sys/net/ipv4/route/flush: Invalid argument


-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
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------

Offline

Board footer

Powered by FluxBB