[bash] Fetchmail

Stato
Discussione chiusa ad ulteriori risposte.

imported_lepa

Utente Silver
28 Settembre 2008
266
11
1
99
Prima usavo lo script di blacklight per fetchmail, ma poi ho pensato di modificarlo per aggiungerci più account...Però mi è venuto fuori un problema, nell'account di gmail mi legge i dati dell' altro account.......
EDIT: in pratica su gmail mi dovrebbe leggere 1/9 invece mi legge 0/32, quello di 0x00.ath.cx
Ecco lo script....

Codice:
#!/bin/sh

while [ 1 -eq 1 ]
do
	fetched=`fetchmail 2> /dev/null | grep "seen"`
	tot1=`echo $fetched | grep "0x00.ath.cx" | awk {'print $1;'}`
	tot2=`echo $fetched | grep "gmail.com" | awk {'print $1;'}`
	seen1=`echo $fetched | grep "0x00.ath.cx" | awk {'print $3;'} | sed -r s/[^0-9]//`
	seen2=`echo $fetched | grep "gmail.com" | awk {'print $3;'} | sed -r s/[^0-9]//`
	new1=`echo $tot1-$seen1 | bc`
	new2=`echo $tot2-$seen2 | bc`
	echo "{0x00: $new1/$tot1} {gmail: $new2/$tot2}" > /tmp/mail
	sleep 600
done
 
Stato
Discussione chiusa ad ulteriori risposte.