Giati exo firewall energopoihmeno (was: Re: iptables script + =?iso-8859-7?q?=E4=F5=ED=E1=F4=FC=F4=E7=F4=E5=F2?=)

Yannis Kotsinos zookie at med.auth.gr
Tue Oct 15 15:30:01 EEST 2002


On Tuesday 15 October 2002 14:35, Giorgos Keramidas wrote:

> Sumperasma: panta exei plaka na trexeis ena firewall kai na koitas ti
> sou grafei sta logs (an exeis arketo disko).

Plug: Kati poy moy 8ymise ena egxeirhma poy eixa 3ekinhsei kai to 
stamathsa sth mesh. Eixa diabasei apo to policy toy hellug ena wraio util 
poy ekane md5sums se sygkekrimena dirs apo8hkeyontas ta apotelesmata se 
ena arxeio. Prospa8hsa na to kanw se shell script poy oysiastika 8a ekane 
wrap to md5sum, kai eftasa se ena shmeio poy katalaba oti 8a me boleye 
ena ypotypwdes recursion h/kai h yposthri3h procedures gia einai kati 
tetoio dynato. px, na dineis:

md5dirsum.sh /usr > hash.out

kai na exeis aytomata ta hashes twn arxeiwn poy briskontai sta subdirs twn 
subdirs k.o.k. Opote telika na mporeis me ena diff dyo diaforetikwn 
hashes na deis an alla3e tipota.

Exei kaneis kammia idea gia to pws mporei na ginei kati tetoio?

kati san (vaguely):

#PSEYTOKWDIKAS (SH STYLE) DISCLAIMER :-)

#na pairnei ws parametro to arxeio (file || dir) poy elegxoyme
procedure1() {
  for i in `ls $1`; do
    procedure2();
}

#na pairnei ws parametro to arxeio (file || dir) poy elegxoyme
procedure2() { 
  if -d $1; then    # an einai dir
    cd $1;             # cd $1
    procedure1($1); # pernwntas parametro to current dir
    cd ..		    # gyrna pisw.
  elif
    md5sum $i;     # alloiws kane to md5sum
  fi
}

#main script
  procedure($1);

Poly pi8anon na exw kapoio la8os sto sxediasmo. Opoia idea/katey8ynsh 
kalodexoymenh :-)

-- 
"What a strange game. The only winning move is not to play"



More information about the Linux-greek-users mailing list