 |

 |
|
 |
| |
04-28-2005, 07:49 AM
|
#12
|
Country: 
|
wooohooo, looked so easy so i wasn't sure if it would work :D
edit: I have a problem:
Code:
--14:53:54-- http://blocklist.org/p2p.p2b.gz%0D
=> `p2p.p2b.gz%0D'
though the script says p2p.p2b.gz - what can i do to fix it?
|
|
|
|
| |
04-29-2005, 07:56 AM
|
#14
|
Country: 
|
found the problem: had to convert from dos2unix. now it works perfect!
|
|
|
|
| |
04-30-2005, 09:03 AM
|
#15
|
Country: 
|
Updated your script for merging:
- added support for .txt-Lists including LISTS in PG-FORMAT! OTHER FORMATS NOT SUPPORTED!!
- readded the more secure way of deleting the lists in ./custom_blocklists
So here's the code:
Code:
#/bin/sh
cd /etc
rm *.p2*
for n in ./custom_blocklists/*.*
do
echo Deleting $n
rm $n
done
cd ./custom_blocklists
wget -c blocklist.org/p2p.p2b.gz
wget -c blocklist.org/gov.p2b.gz
wget -c blocklist.org/spy.p2b.gz
wget -c blocklist.org/ads.p2b.gz
wget -c ANY .TXT FILE LINK INCLUDING PG-FORMATTED RULES!
cd ..
for n in ./custom_blocklists/*.txt
do
echo Converting $n
mv $n $n.p2p
done
for n in ./custom_blocklists/*.gz
do
echo Extracting $n
gunzip $n
done
for n in ./custom_blocklists/*.p2b
do
echo Converting $n
peerguardnf -n $n
done
for n in ./custom_blocklists/*.p2p
do
echo Appending $n
cat $n >> /etc/p2p.p2b.p2p
done
killall peerguardnf
peerguardnf -d -c /etc/PG.conf -l /var/log/PG.log -h -m
|
|
|
|
| |
04-30-2005, 09:30 AM
|
#17
|
Country: 
|
First testings show me that it seems to work. But i think it depends on the lists you're working with! they HAVE TO BE in PG-FORMAT like bluetacks.
|
|
|
|
| |
05-30-2005, 04:59 PM
|
#18
|
Country: 
|
it runs on my Slackware...
Hi.
It's my experience with Peerguardian as daemon.
2 scripts are running on my workstation (Slackware-current).
I'm busy man, it was fast work.
First script updates lists of peers and it's located in /usr/bin (it runs under cron too):
pgupdate
#!/bin/sh
killall peerguardnf
cd /etc
rm p2p.p2b.p2p
rm p2p.p2b
rm ads.p2b.p2p
rm ads.p2b
rm edu.p2b.p2p
rm edu.p2b
rm gov.p2b.p2p
rm gov.p2b
rm spy.p2b.p2p
rm spy.p2b
wget -c blocklist.org/p2p.p2b.gz
gunzip p2p.p2b.gz
wget -c blocklist.org/ads.p2b.gz
gunzip ads.p2b.gz
wget -c blocklist.org/edu.p2b.gz
gunzip edu.p2b.gz
wget -c blocklist.org/gov.p2b.gz
gunzip gov.p2b.gz
wget -c blocklist.org/spy.p2b.gz
gunzip spy.p2b.gz
peerguardnf -n p2p.p2b
peerguardnf -n ads.p2b
peerguardnf -n edu.p2b
peerguardnf -n gov.p2b
peerguardnf -n spy.p2b
cat ads.p2b.p2p >> p2p.p2b.p2p
cat edu.p2b.p2p >> p2p.p2b.p2p
cat gov.p2b.p2p >> p2p.p2b.p2p
cat spy.p2b.p2p >> p2p.p2b.p2p
peerguardnf -d -c /etc/PG.conf -l /var/log/PG.log -h -m
Second exists into /etc/rc.d
rc.peerguardnf
#!/bin/sh
# Start/stop/restart peerguardian.
# Start peerguardnf:
peerguardnf_start() {
if [ -x /usr/bin/peerguardnf ]; then
echo "Starting peerguardian: /usr/bin/peerguardnf"
/usr/bin/pgupdate
echo "done."
fi
}
# Stop peerguardnf:
peerguardnf_stop() {
killall peerguardnf
}
# Restart peerguardnf:
peerguardnf_restart() {
peerguardnf_stop
sleep 1
peerguardnf_start
}
case "$1" in
'start')
peerguardnf_start
;;
'stop')
peerguardnf_stop
;;
'restart')
peerguardnf_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
You must to start rc.peerguardnf when system starts - exampl. put into rc.M lines: # If there are peerguardian init scripts for this runlevel, run them.
if [ -x /etc/rc.d/rc.peerguardnf ]; then
. /etc/rc.d/rc.peerguardnf start
fi
I use it with the gambas GUI under KDE3.4. No problems.
PS. You must to be root on your system.
Regards from:
marekjs
|
|
|
|
| |
06-06-2005, 03:53 AM
|
#19
|
Country: 
|
Nice Script runs on my maschine ver well ;)
Mandriva LE 2005
|
|
|
|
| |
08-05-2005, 04:49 AM
|
#20
|
Country: 
|
this is an extract from my initscript, if it can't get a new blocklist it uses the one it already has.
d_start() {
cd /etc
if wget lists.blocklist.org/p2p.p2b.gz
then
echo "Extracting new blocklist."
if gunzip p2p.p2b.gz
then
echo "Renaming p2p.p2b to p2p.p2b.p2p."
mv p2p.p2b p2p.p2b.p2p
fi
else
echo "Using old blocklist."
fi
$DAEMON -d -c /etc/PG.conf -l /var/log/PG.log -m
}
but i'm always having trouble with stopping the daemon. when i'm connected through a remote shell and do a killall -9 peerguardnf my shell hangs most of the times and i even cannot open or use another one. i always have to reboot the server manually. what's the one and only way of stopping the daemon, there seem to be some things one has to keep in mind.
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:07 AM.
 |
|
 |
|
 |