2011-05-27 11:22:19 +12:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2012-08-30 15:13:14 +12:00
|
|
|
# Fanboy Adblock Iron Convert script v2.0 (30/08/2012)
|
2011-05-27 11:22:19 +12:00
|
|
|
# Dual License CCby3.0/GPLv2
|
|
|
|
# http://creativecommons.org/licenses/by/3.0/
|
|
|
|
# http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
#
|
|
|
|
|
2012-08-30 15:13:14 +12:00
|
|
|
export ZIP="nice -n 19 /usr/local/bin/7za a -mx=9 -y -tgzip"
|
|
|
|
export NICE="nice -n 19"
|
|
|
|
export TAC="/usr/bin/tac"
|
|
|
|
export CAT="/bin/cat"
|
|
|
|
export MAINDIR="/tmp/Ramdisk/www/adblock"
|
|
|
|
export SPLITDIR="/tmp/Ramdisk/www/adblock/split/test"
|
|
|
|
export HGSERV="/tmp/hgstuff/fanboy-adblock-list"
|
|
|
|
export TESTDIR="/tmp/work"
|
|
|
|
export DATE="`date`"
|
|
|
|
export ADDCHECKSUM="nice -n 19 perl $HGSERV/scripts/addChecksum.pl"
|
2012-08-30 15:29:40 +12:00
|
|
|
export ADDCHECKSUMIRON="nice -n 19 perl $HGSERV/scripts/addChecksum-iron.pl"
|
2012-08-30 15:13:14 +12:00
|
|
|
export LOGFILE="/etc/crons/log.txt"
|
|
|
|
export HG="/usr/local/bin/hg"
|
|
|
|
export SHA256SUM="/usr/bin/sha256sum"
|
|
|
|
export IEDIR="/tmp/ieramdisk"
|
|
|
|
export TWIDGE="/usr/bin/twidge update"
|
|
|
|
export SUBS="/tmp/ieramdisk/subscriptions"
|
2011-05-27 11:22:19 +12:00
|
|
|
|
|
|
|
|
2011-09-04 20:55:03 +12:00
|
|
|
# Split the Opera-specific stuff off... into its own list
|
2011-09-03 22:05:11 +12:00
|
|
|
#
|
2012-08-15 19:45:51 +12:00
|
|
|
sed -n '/Stats list (Opera)/,/Wildcards/{/Wildcards/!p}' $MAINDIR/opera/complete/urlfilter.ini > $TESTDIR/urlfilter3.ini
|
2011-09-03 22:05:11 +12:00
|
|
|
|
2011-09-04 20:55:03 +12:00
|
|
|
# remove ; from the file
|
2011-05-27 11:22:19 +12:00
|
|
|
#
|
2011-09-04 20:55:03 +12:00
|
|
|
sed '/^\;/d' $TESTDIR/urlfilter3.ini > $TESTDIR/urlfilter4.ini
|
2011-05-27 11:22:19 +12:00
|
|
|
|
|
|
|
# remove the top line
|
|
|
|
#
|
2011-09-04 20:55:03 +12:00
|
|
|
sed '1d' $TESTDIR/urlfilter4.ini > $TESTDIR/urlfilter-stats.ini
|
2011-05-27 11:22:19 +12:00
|
|
|
|
|
|
|
# Merge with tracking
|
2011-09-03 22:05:11 +12:00
|
|
|
#
|
2012-08-30 15:13:14 +12:00
|
|
|
cat $MAINDIR/iron/adblock.ini $TESTDIR/urlfilter-stats.ini > $TESTDIR/adblock-stats.ini
|
2011-05-27 11:22:19 +12:00
|
|
|
|
|
|
|
# remove any blank lines
|
|
|
|
#
|
|
|
|
sed '/^$/d' $TESTDIR/adblock-stats.ini > $TESTDIR/adblock2-stats.ini
|
|
|
|
|
|
|
|
# remove any wildcards
|
|
|
|
#
|
2012-08-30 15:13:14 +12:00
|
|
|
tr -d '*' <$TESTDIR/adblock2-stats.ini >$MAINDIR/iron/complete/adblock.ini
|
2011-05-27 11:22:19 +12:00
|
|
|
|
|
|
|
# Checksum the file (Done)
|
|
|
|
#
|
2012-08-30 15:29:40 +12:00
|
|
|
$ADDCHECKSUMIRON $MAINDIR/iron/complete/adblock.ini
|
2012-08-30 15:13:14 +12:00
|
|
|
rm $MAINDIR/iron/complete/adblock.ini.gz
|
2011-05-27 11:22:19 +12:00
|
|
|
|
|
|
|
# echo "adblock.ini copied" > /dev/null
|
|
|
|
#
|
2012-09-06 00:29:20 +12:00
|
|
|
$ZIP $MAINDIR/iron/complete/adblock.ini.gz $MAINDIR/iron/complete/adblock.ini > /dev/null
|
2011-05-27 11:22:19 +12:00
|
|
|
|