fanboy-adblock/scripts/list-grabber.sh

1046 lines
47 KiB
Bash
Raw Normal View History

2011-04-18 13:47:24 +12:00
#!/bin/bash
#
2012-07-18 14:40:40 +12:00
# Fanboy Adblock list grabber script v1.75 (18/07/2012)
2011-04-18 13:47:24 +12:00
# Dual License CCby3.0/GPLv2
# http://creativecommons.org/licenses/by/3.0/
# http://www.gnu.org/licenses/gpl-2.0.html
#
2012-07-18 13:20:34 +12:00
# Version history
2012-07-18 14:40:40 +12:00
# 1.75 Store log in ramdisk to avoid unnessary writes (Currently disabled)
2012-07-18 13:20:34 +12:00
# 1.74 Store repo in ramdisk to avoid unnessary writes (Currently disabled)
#
2011-04-18 13:47:24 +12:00
# Variables for directorys
#
MAINDIR="/var/www/adblock"
GOOGLEDIR="/home/fanboy/google/fanboy-adblock-list"
2011-04-18 13:47:24 +12:00
TESTDIR="/tmp/ramdisk"
2012-02-14 18:35:25 +13:00
ZIP="nice -n 19 /usr/local/bin/7za"
2012-02-14 18:39:24 +13:00
NICE="nice -n 19"
2012-02-14 19:02:42 +13:00
SHRED="nice -n 19 /usr/bin/shred"
2012-02-28 20:42:07 +13:00
LOGFILE="/etc/crons/log-listgrabber.txt"
DATE="`date`"
ECHORESPONSE="List Changed: $LS2"
BADUPDATE="Bad Update: $LS2"
LS2="`ls -al $FILE`"
2012-03-17 19:43:15 +13:00
SHA256SUM=/usr/bin/sha256sum
2012-03-17 20:13:19 +13:00
HG=/usr/local/bin/hg
2012-03-18 19:38:31 +13:00
TAIL=/usr/bin/tail
LOGFILE2=/var/log/adblock-log.txt
2012-03-11 15:33:01 +13:00
# Make Ramdisk.
#
$GOOGLEDIR/scripts/ramdisk.sh
# Fallback if ramdisk.sh isn't excuted.
#
if [ ! -d "/tmp/ramdisk/" ]; then
rm -rf /tmp/ramdisk/
mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk
mount -t tmpfs -o size=30M tmpfs /tmp/ramdisk/
mkdir /tmp/ramdisk/opera; chmod 777 /tmp/ramdisk/opera
mkdir /tmp/ramdisk/opera/test; chmod 777 /tmp/ramdisk/opera/test
2012-03-11 15:33:01 +13:00
fi
2012-07-18 13:20:34 +12:00
# Fallback if ramdisk.sh isn't excuted. (mercurial repo in ramdisk)
#
#if [ ! -d "/tmp/hg-ramdisk/" ]; then
# rm -rf /tmp/hg-ramdisk/
# mkdir /tmp/hg-ramdisk; chmod 777 /tmp/hg-ramdisk
# mount -t tmpfs -o size=110M tmpfs /tmp/hg-ramdisk/
# cd /home/fanboy/google/fanboy-adblock-list/
# $NICE $HG pull >> /dev/null
# $NICE $HG update >> /dev/null
# cp -rf /home/fanboy/google/fanboy-adblock-list/ /tmp/hg-ramdisk/
#fi
2012-07-18 14:40:40 +12:00
# Fallback if ramdisk.sh isn't excuted. (mercurial repo in ramdisk)
#
#if [ ! -d "/tmp/hg-log/" ]; then
# rm -rf /tmp/hg-log/
# mkdir /tmp/hg-log; chmod 777 /tmp/hg-log
# mount -t tmpfs -o size=10M tmpfs /tmp/hg-log/
# rm -rf $LOGFILE2 ; cd /var/www ; ln -s /tmp/hg-log/adblock.log .
#fi
2012-03-17 18:09:05 +13:00
# Make sure the shell scripts are exexcutable, all the time..
#
chmod a+x $GOOGLEDIR/scripts/ie/*.sh $GOOGLEDIR/scripts/iron/*.sh $GOOGLEDIR/scripts/*.sh $GOOGLEDIR/scripts/firefox/*.sh $GOOGLEDIR/scripts/combine/*.sh
2012-03-11 15:33:01 +13:00
2012-02-14 18:39:24 +13:00
# Grab Mercurial Updates
#
cd /home/fanboy/google/fanboy-adblock-list/
echo "------------------------- Start of script -------------------------" >> $LOGFILE2
echo "Updated hg (hg pull ; hg update (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
$NICE $HG pull >> $LOGFILE2
$NICE $HG update >> $LOGFILE2
echo "------ End of hg pull and Update ------" >> $LOGFILE2
2011-04-18 13:47:24 +12:00
2012-03-18 19:38:31 +13:00
# Log Changes
#
$NICE $TAIL -n 6000 $LOGFILE2 > /var/www/adblock.log
#$NICE tac $LOGFILE2 | head -n 6000 > /var/www/adblock.log
2012-03-18 19:38:31 +13:00
2012-03-17 18:09:05 +13:00
# Main List
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-adblock.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-adblock.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt $SSLGOOGLE"
2011-04-18 13:47:24 +12:00
#
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
2012-03-17 18:09:05 +13:00
then
# Log
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-adblock.txt`" >> $LOGFILE2
echo "Googles copy: `cat $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt | grep Checksum: ;echo HASH: $SSLGOOGLE`" >> $LOGFILE2
echo "Local copy: `cat $MAINDIR/fanboy-adblock.txt | grep Checksum: ;echo HASH: $SSLMAIN`" >> $LOGFILE2
echo "Updated fanboy-adblock.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-adblock.txt" >> $LOGFILE2
2012-07-01 14:36:11 +12:00
$NICE diff -Naur $MAINDIR/fanboy-adblock.txt $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt > $TESTDIR/fanboy-adblock.patch
cat $TESTDIR/fanboy-adblock.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-adblock.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-adblock.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt $SSLGOOGLE"
# Make sure the old copy is cleared before we start
rm -f $TESTDIR/fanboy-adblock.txt.gz $TESTDIR/fanboy-adblock.txt
# Copy to ram disk first. (quicker)
cp -f $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt $TESTDIR/fanboy-adblock.txt
2011-08-02 00:18:28 +12:00
# Re-generate checksum
perl $TESTDIR/addChecksum.pl $TESTDIR/fanboy-adblock.txt
cp -f $TESTDIR/fanboy-adblock.txt $MAINDIR/fanboy-adblock.txt
# Compress file in Ram disk
$ZIP a -mx=9 -y -tgzip $TESTDIR/fanboy-adblock.txt.gz $TESTDIR/fanboy-adblock.txt > /dev/null
2012-02-15 23:55:36 +13:00
# Clear Webhost-copy before copying
2012-07-01 14:36:11 +12:00
rm -f $MAINDIR/fanboy-adblock.txt.gz $TESTDIR/fanboy-adblock.patch
2012-03-18 19:38:31 +13:00
2012-02-15 23:55:36 +13:00
# Now Copy over GZip'd list
cp -f $TESTDIR/fanboy-adblock.txt.gz $MAINDIR/fanboy-adblock.txt.gz
2011-05-26 12:08:25 +12:00
# perl $TESTDIR/addChecksum.pl $TESTDIR/firefox-expanded.txt-org2
# cp -f $TESTDIR/firefox-expanded.txt-org2 $MAINDIR/fanboy-adblock.txt
# cp -f $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt $MAINDIR/fanboy-adblock.txt
# cp -f $TESTDIR/fanboy-adblocklist-current-expanded.txt $MAINDIR/fanboy-adblock.txt
2012-03-17 17:58:07 +13:00
2011-04-18 13:47:24 +12:00
# The Dimensions List
2012-03-17 18:09:05 +13:00
### echo "Updated: fanboy-dimensions.txt"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/firefox/fanboy-dimensions.sh
2012-03-17 17:58:07 +13:00
2011-04-18 13:47:24 +12:00
# The Adult List
2012-03-17 18:09:05 +13:00
### echo "Updated: fanboy-adult.txt"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/firefox/fanboy-adult.sh
2011-05-26 11:46:18 +12:00
2011-04-18 13:47:24 +12:00
# The P2P List
2012-03-17 18:09:05 +13:00
### echo "Updated: fanboy-p2p.txt"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/firefox/fanboy-p2p.sh
2011-05-26 11:57:31 +12:00
2011-05-26 12:25:59 +12:00
# Seperate off CSS elements for Opera CSS
2012-03-17 18:09:05 +13:00
### echo "Updated: fanboy-element-opera-generator.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/firefox/fanboy-element-opera-generator.sh
2012-03-17 17:58:07 +13:00
2011-04-18 13:47:24 +12:00
# Seperate off Elements
2012-03-17 18:09:05 +13:00
### echo "Updated: fanboy-noele.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/firefox/fanboy-noele.sh
2012-03-17 17:58:07 +13:00
2011-06-12 14:57:18 +12:00
# Combine (Czech)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-czech.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-czech.sh
2011-06-12 14:57:18 +12:00
# Combine (Espanol)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-esp.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-esp.sh
2011-06-12 14:57:18 +12:00
# Combine (Russian)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-rus.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-rus.sh
2011-06-12 14:57:18 +12:00
# Combine (Japanese)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-jpn.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-jpn.sh
2011-06-12 14:57:18 +12:00
# Combine (Swedish)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-swe.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-swe.sh
2011-06-12 14:57:18 +12:00
# Combine (Chinese)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-chn.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-chn.sh
2011-06-12 14:57:18 +12:00
# Combine (Vietnam)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-vtn.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-vtn.sh
2011-06-12 14:57:18 +12:00
# Combine (Vietnam)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-krn.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-krn.sh
2011-06-12 14:57:18 +12:00
# Combine (Turkish)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-turk.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-turk.sh
2011-06-12 14:57:18 +12:00
# Combine (Italian)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-ita.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-ita.sh
2011-06-12 14:57:18 +12:00
# Combine (Polish)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-pol.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-pol.sh
2012-05-11 15:49:01 +12:00
# Combine (Indian)
### echo "Combine: firefox-adblock-ind.sh"
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-ind.sh
# Combine Regional trackers
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-intl-tracking.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-06-12 14:57:18 +12:00
# Combine
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-tracking.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-tracking.sh
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-merged.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-merged.sh
# Combine (Main+Tracking+Enhanced) and Ultimate (Main+Tracking+Enhanced+Annoyances)
2012-03-17 18:09:05 +13:00
### echo "Combine: firefox-adblock-ultimate.sh"
2012-02-14 19:02:42 +13:00
$NICE $GOOGLEDIR/scripts/combine/firefox-adblock-ultimate.sh
2012-05-20 22:33:51 +12:00
# Firefox2Opera
# $NICE $GOOGLEDIR/scripts/firefox2opera.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-adblock.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-adblock.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-adblock.txt $GOOGLEDIR/fanboy-adblocklist-current-expanded.txt
2011-04-18 13:47:24 +12:00
fi
2012-03-17 18:09:05 +13:00
# Tracking List
# Store Encryption data on whats on the server vs googlecode
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/fanboy-adblocklist-stats.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-tracking.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-tracking.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-stats.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-tracking.txt $GOOGLEDIR/fanboy-adblocklist-stats.txt
2011-04-18 13:47:24 +12:00
# Tracking
# Check for 0-sized file first
#
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
2012-03-17 18:09:05 +13:00
then
# Log
echo "Updated fanboy-tracking.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/fanboy-adblocklist-stats.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-tracking.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-tracking.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-tracking.txt $GOOGLEDIR/fanboy-adblocklist-stats.txt > $TESTDIR/fanboy-tracking.patch
$NICE cat $TESTDIR/fanboy-tracking.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-tracking.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-tracking.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-stats.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-tracking.txt $GOOGLEDIR/fanboy-adblocklist-stats.txt
2012-02-15 23:55:36 +13:00
# Clear old list
rm -f $TESTDIR/fanboy-tracking.txt.gz $TESTDIR/fanboy-tracking.txt
# Copy list from repo to RAMDISK
cp -f $GOOGLEDIR/fanboy-adblocklist-stats.txt $TESTDIR/fanboy-tracking.txt
2011-08-02 00:18:28 +12:00
# Re-generate checksum
2012-02-15 23:55:36 +13:00
perl $TESTDIR/addChecksum.pl $TESTDIR/fanboy-tracking.txt
# GZip
$ZIP a -mx=9 -y -tgzip $TESTDIR/fanboy-tracking.txt.gz $TESTDIR/fanboy-tracking.txt > /dev/null
# Create a log
FILE="$TESTDIR/fanboy-tracking.txt"
echo $ECHORESPONSE >> $LOGFILE
2012-02-15 23:55:36 +13:00
# Clear Webhost-copy before copying and Copy over GZip'd list
cp -f $TESTDIR/fanboy-tracking.txt $MAINDIR/fanboy-tracking.txt
2012-07-01 14:36:11 +12:00
rm -f $MAINDIR/fanboy-tracking.txt.gz $TESTDIR/fanboy-tracking.patch
2012-02-14 18:00:42 +13:00
cp -f $TESTDIR/fanboy-tracking.txt.gz $MAINDIR/fanboy-tracking.txt.gz
2011-04-18 13:47:24 +12:00
# Now combine with international list
sh /etc/crons/hg-grab-intl.sh
# Generate IE script
2011-05-23 00:13:51 +12:00
$GOOGLEDIR/scripts/ie/tracking-ie-generator.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-tracking.sh
$GOOGLEDIR/scripts/combine/firefox-adblock-merged.sh
# Combine (Main+Tracking+Enhanced) and Ultimate (Main+Tracking+Enhanced+Annoyances)
$GOOGLEDIR/scripts/combine/firefox-adblock-ultimate.sh
2012-05-20 22:33:51 +12:00
# Firefox2Opera
# $NICE $GOOGLEDIR/scripts/firefox2opera.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-tracking.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-tracking.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-stats.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-tracking.txt $GOOGLEDIR/fanboy-adblocklist-stats.txt
2011-04-18 13:47:24 +12:00
fi
2011-06-07 01:12:40 +12:00
# Enhanced Trackers
2012-03-17 18:09:05 +13:00
# Store Encryption data on whats on the server vs googlecode
2011-06-07 01:12:40 +12:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/enhancedstats-addon.txt | cut -d' ' -f1)
2012-03-18 21:19:23 +13:00
SSLMAIN=$($SHA256SUM $MAINDIR/enhancedstats.txt-org | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/enhancedstats.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/enhancedstats-addon.txt $SSLGOOGLE"
### ls -al $MAINDIR/enhancedstats.txt $GOOGLEDIR/enhancedstats-addon.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
2012-03-16 22:10:03 +13:00
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated enhancedstats.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/enhancedstats-addon.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/enhancedstats.txt-org`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-enhancedstats.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/enhancedstats.txt-org $GOOGLEDIR/enhancedstats-addon.txt > $TESTDIR/fanboy-enhancedtracking.patch
$NICE cat $TESTDIR/fanboy-enhancedtracking.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: enhancedstats-addon.txt"
### echo "SSLMAIN: $MAINDIR/enhancedstats.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/enhancedstats-addon.txt $SSLGOOGLE"
### ls -al $MAINDIR/enhancedstats.txt $GOOGLEDIR/enhancedstats-addon.txt
2012-02-15 23:55:36 +13:00
# Clear old list
rm -f $TESTDIR/enhancedstats.txt $TESTDIR/enhancedstats.txt.gz
# Copy list from repo to RAMDISK
cp -f $GOOGLEDIR/enhancedstats-addon.txt $TESTDIR/enhancedstats.txt
2012-03-18 21:19:23 +13:00
# Copy Orginal file over
2012-07-01 11:27:34 +12:00
cp -f $GOOGLEDIR/enhancedstats-addon.txt $MAINDIR/enhancedstats.txt-org
2012-02-15 23:55:36 +13:00
# GZip
$ZIP a -mx=9 -y -tgzip $TESTDIR/enhancedstats.txt.gz $TESTDIR/enhancedstats.txt > /dev/null
# Create a log
FILE="$TESTDIR/enhancedstats.txt"
echo $ECHORESPONSE >> $LOGFILE
2012-02-15 23:55:36 +13:00
# Clear Webhost-copy before copying and now Copy over GZip'd list
cp -f $TESTDIR/enhancedstats.txt $MAINDIR/enhancedstats.txt
2012-07-01 16:20:24 +12:00
rm -f $MAINDIR/enhancedstats.txt.gz $TESTDIR/fanboy-enhancedtracking.patch
2012-02-14 18:00:42 +13:00
cp -f $TESTDIR/enhancedstats.txt.gz $MAINDIR/enhancedstats.txt.gz
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-merged.sh
# Combine (Main+Tracking+Enhanced) and Ultimate (Main+Tracking+Enhanced+Annoyances)
$GOOGLEDIR/scripts/combine/firefox-adblock-ultimate.sh
2012-05-20 22:33:51 +12:00
# Firefox2Opera
# $NICE $GOOGLEDIR/scripts/firefox2opera.sh
2011-06-07 01:12:40 +12:00
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: enhancedstats.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/enhancedstats.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/enhancedstats-addon.txt $SSLGOOGLE"
### ls -al $MAINDIR/enhancedstats.txt $GOOGLEDIR/enhancedstats-addon.txt
2011-06-07 01:12:40 +12:00
fi
2011-04-18 13:47:24 +12:00
# Addon/Annoyances
2012-03-17 18:09:05 +13:00
# Store Encryption data on whats on the server vs googlecode
2011-04-18 13:47:24 +12:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/fanboy-adblocklist-addon.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-addon.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-addon.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-addon.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-addon.txt $GOOGLEDIR/fanboy-adblocklist-addon.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
2012-03-16 22:10:03 +13:00
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-addon.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/fanboy-adblocklist-addon.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-addon.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-annoyances.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-addon.txt $GOOGLEDIR/fanboy-adblocklist-addon.txt > $TESTDIR/fanboy-annoy.patch
$NICE cat $TESTDIR/fanboy-annoy.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-addon.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-addon.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-addon.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-addon.txt $GOOGLEDIR/fanboy-adblocklist-addon.txt
2012-02-15 23:55:36 +13:00
# Clear old list
2012-07-01 16:20:24 +12:00
rm -f $TESTDIR/fanboy-addon.txt $TESTDIR/fanboy-addon.txt.gz
2012-02-15 23:55:36 +13:00
# Copy list from repo to RAMDISK
cp -f $GOOGLEDIR/fanboy-adblocklist-addon.txt $TESTDIR/fanboy-addon.txt
# GZip
2012-02-14 18:00:42 +13:00
$ZIP a -mx=9 -y -tgzip $TESTDIR/fanboy-addon.txt.gz $TESTDIR/fanboy-addon.txt > /dev/null
# Create a log
FILE="$TESTDIR/fanboy-addon.txt"
echo $ECHORESPONSE >> $LOGFILE
2012-02-15 23:55:36 +13:00
# Clear Webhost-copy before copying and now Copy over GZip'd list
cp -f $TESTDIR/fanboy-addon.txt $MAINDIR/fanboy-addon.txt
2012-07-01 16:20:24 +12:00
rm -f $MAINDIR/fanboy-addon.txt.gz $TESTDIR/fanboy-annoy.patch
2012-02-14 18:00:42 +13:00
cp -f $TESTDIR/fanboy-addon.txt.gz $MAINDIR/fanboy-addon.txt.gz
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-merged.sh
# Combine (Main+Tracking+Enhanced) and Ultimate (Main+Tracking+Enhanced+Annoyances)
$GOOGLEDIR/scripts/combine/firefox-adblock-ultimate.sh
2012-05-20 22:33:51 +12:00
# Firefox2Opera
# $NICE $GOOGLEDIR/scripts/firefox2opera.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-addon.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-addon.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/fanboy-adblocklist-addon.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-addon.txt $GOOGLEDIR/fanboy-adblocklist-addon.txt
2011-04-18 13:47:24 +12:00
fi
# CZECH
2012-03-17 18:09:05 +13:00
# Store Encryption data on whats on the server vs googlecode
2011-04-18 13:47:24 +12:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-czech.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-czech.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt $SSLGOOGLE"
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-czech.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-czech.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-czech.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-czech.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt > $TESTDIR/fanboy-czech.patch
$NICE cat $TESTDIR/fanboy-czech.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-czech.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-czech.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-czech.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt $MAINDIR/fanboy-czech.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-czech.txt.gz $TESTDIR/fanboy-czech.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-czech.txt.gz $MAINDIR/fanboy-czech.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-czech.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-04-18 13:47:24 +12:00
# Generate IE script
2011-05-23 00:13:51 +12:00
$GOOGLEDIR/scripts/ie/czech-ie-generator.sh
2011-06-12 13:48:56 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-czech.sh
2012-07-01 16:20:24 +12:00
# Remove uneeded file
rm -rf $TESTDIR/fanboy-czech.patch
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-czech.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-czech.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-czech.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-cz.txt
2011-04-18 13:47:24 +12:00
fi
# RUSSIAN
2012-03-17 18:09:05 +13:00
# Store Encryption data on whats on the server vs googlecode
2011-04-18 13:47:24 +12:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-russian.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-russian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-russian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-russian.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-russian.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-russian.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-russian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt > $TESTDIR/fanboy-russian.patch
$NICE cat $TESTDIR/fanboy-russian.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-russian.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-russian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-russian.txtt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt $MAINDIR/fanboy-russian.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-russian.txt.gz $TESTDIR/fanboy-russian.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-russian.txt.gz $MAINDIR/fanboy-russian.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-russian.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-04-18 13:47:24 +12:00
# Generate IE script
2011-05-23 00:13:51 +12:00
$GOOGLEDIR/scripts/ie/russian-ie-generator.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-rus.sh
# Generate Opera RUS script also
$GOOGLEDIR/scripts/firefox/opera-russian.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-russian.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-russian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-russian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-rus-v2.txt
2011-04-18 13:47:24 +12:00
fi
# TURK
2012-03-17 18:09:05 +13:00
# Store Encryption data on whats on the server vs googlecode
2011-04-18 13:47:24 +12:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-turkish.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-turkish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-turkish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-turkish.txt (sctipt: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-turkish.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-turkish.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-turkish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt > $TESTDIR/fanboy-turk.patch
$NICE cat $TESTDIR/fanboy-turk.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-turkish.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-turkish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-turkish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt $MAINDIR/fanboy-turkish.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-turkish.txt.gz $TESTDIR/fanboy-turk.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-turkish.txt.gz $MAINDIR/fanboy-turkish.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-turkish.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-04-18 13:47:24 +12:00
# Generate IE script
2011-06-12 14:57:18 +12:00
$GOOGLEDIR/scripts/ie/turkish-ie-generator.sh
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-turk.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-turkish.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-turkish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-turkish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-tky.txt
2011-04-18 13:47:24 +12:00
fi
# JAPANESE
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2011-04-18 13:47:24 +12:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-japanese.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-japanese.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-japanese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-japanese.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-japanese.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-japanese.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-japanese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt > $TESTDIR/fanboy-jpn.patch
$NICE cat $TESTDIR/fanboy-jpn.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-japanese.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-japanese.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-japanese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt $MAINDIR/fanboy-japanese.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-japanese.txt.gz $TESTDIR/fanboy-jpn.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-japanese.txt.gz $MAINDIR/fanboy-japanese.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-japanese.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-04-18 13:47:24 +12:00
# Generate IE script
2012-03-24 23:05:14 +13:00
$GOOGLEDIR/scripts/ie/japanese-ie-generator.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-jpn.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-japanese.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-japanese.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-japanese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-jpn.txt
2011-04-18 13:47:24 +12:00
fi
# KOREAN
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt | cut -d' ' -f1)
2012-07-01 16:20:24 +12:00
SSLMAIN=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-korean.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-korean.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-korean.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-korean.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-korean.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-japanese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt > $TESTDIR/fanboy-krn.patch
$NICE cat $TESTDIR/fanboy-krn.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-korean.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-korean.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-korean.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt $MAINDIR/fanboy-korean.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-korean.txt.gz $TESTDIR/fanboy-krn.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-korean.txt.gz $MAINDIR/fanboy-korean.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-korean.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-krn.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-korean.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-korean.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-korean.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-krn.txt
2011-04-18 13:47:24 +12:00
fi
2011-04-18 13:47:24 +12:00
# ITALIAN
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-italian.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-italian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-italian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-italian.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-italian.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-italian.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-italian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt > $TESTDIR/fanboy-ita.patch
$NICE cat $TESTDIR/fanboy-ita.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-italian.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-italian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-italian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt $MAINDIR/fanboy-italian.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-italian.txt.gz $TESTDIR/fanboy-ita.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-italian.txt.gz $MAINDIR/fanboy-italian.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-italian.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-04-18 13:47:24 +12:00
# Generate IE script
2011-06-12 14:57:18 +12:00
$GOOGLEDIR/scripts/ie/italian-ie-generator.sh
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-ita.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-italian.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-italian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-italian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ita.txt
2011-04-18 13:47:24 +12:00
fi
# POLISH
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-polish.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-polish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-polish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-polish.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-polish.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-polish.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-polish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt > $TESTDIR/fanboy-pol.patch
$NICE cat $TESTDIR/fanboy-pol.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-polish.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-polish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-polish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt $MAINDIR/fanboy-polish.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-polish.txt.gz $TESTDIR/fanboy-pol.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-polish.txt.gz $MAINDIR/fanboy-polish.txt /dev/null
# Create a log
FILE="$MAINDIR/fanboy-polish.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-pol.sh
2012-07-01 16:20:24 +12:00
# Remove uneeded file
rm -rf $TESTDIR/fanboy-pol.patch
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-polish.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-polish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-polish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-pol.txt
2011-04-18 13:47:24 +12:00
fi
# INDIAN
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-indian.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-indian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-indian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-indian.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-indian.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-indian.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-indian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt > $TESTDIR/fanboy-ind.patch
$NICE cat $TESTDIR/fanboy-ind.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-indian.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-indian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-indian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt $MAINDIR/fanboy-indian.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-indian.txt.gz $TESTDIR/fanboy-ind.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-indian.txt.gz $MAINDIR/fanboy-indian.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-indian.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-ind.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-indian.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-indian.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-indian.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-ind.txt
2011-04-18 13:47:24 +12:00
fi
# VIETNAM
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-vietnam.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-vietnam.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-vietnam.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-vietnam.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-vietnam.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-vietnam.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-vietnam.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt > $TESTDIR/fanboy-vtn.patch
$NICE cat $TESTDIR/fanboy-vtn.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-vietnam.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-vietnam.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-vietnam.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt $MAINDIR/fanboy-vietnam.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-vietnam.txt.gz $TESTDIR/fanboy-vtn.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-vietnam.txt.gz $MAINDIR/fanboy-vietnam.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-vietnam.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-vtn.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-vietnam.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-vietnam.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-vietnam.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-vtn.txt
2011-04-18 13:47:24 +12:00
fi
# CHINESE
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-chinese.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-chinese.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-chinese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-chinese.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-chinese.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-chinese.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-chinese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt > $TESTDIR/fanboy-chn.patch
$NICE cat $TESTDIR/fanboy-chn.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-chinese.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-chinese.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-chinese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt $MAINDIR/fanboy-chinese.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-chinese.txt.gz $TESTDIR/fanboy-chn.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-chinese.txt.gz $MAINDIR/fanboy-chinese.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-chinese.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-chn.sh
2012-07-01 16:20:24 +12:00
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-chinese.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "SSLMAIN: $MAINDIR/fanboy-chinese.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-chinese.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-chn.txt
2011-04-18 13:47:24 +12:00
fi
# ESPANOL
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-espanol.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-espanol.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-espanol.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
# Log
echo "Updated fanboy-espanol.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-espanol.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-espanol.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-espanol.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt > $TESTDIR/fanboy-esp.patch
$NICE cat $TESTDIR/fanboy-esp.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-espanol.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-espanol.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-espanol.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt $MAINDIR/fanboy-espanol.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-espanol.txt.gz $TESTDIR/fanboy-esp.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-espanol.txt.gz $MAINDIR/fanboy-espanol.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-espanol.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-04-18 13:47:24 +12:00
# Generate IE script
2011-05-23 00:13:51 +12:00
$GOOGLEDIR/scripts/ie/espanol-ie-generator.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-esp.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-espanol.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "Not updated: fanboy-espanol.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-espanol.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-espanol.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-esp.txt
2011-04-18 13:47:24 +12:00
fi
# SWEDISH
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/fanboy-swedish.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/fanboy-swedish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-swedish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-swedish.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-swedish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt $SSLGOOGLE"
### ls -al $MAINDIR/fanboy-swedish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt
# Log
echo "Updated fanboy-swedish.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-07-09 23:25:03 +12:00
echo "Googles copy: `ls -al $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt`" >> $LOGFILE2
echo "Local copy: `ls -al $MAINDIR/fanboy-swedish.txt`" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
# Write patch to log file
#
echo " " >> $LOGFILE2
echo "Changes to File: fanboy-swedish.txt" >> $LOGFILE2
2012-07-01 16:20:24 +12:00
$NICE diff -Naur $MAINDIR/fanboy-swedish.txt $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt > $TESTDIR/fanboy-swe.patch
$NICE cat $TESTDIR/fanboy-swe.patch >> $LOGFILE2
echo " " >> $LOGFILE2
2012-07-01 16:20:24 +12:00
#
2011-04-18 13:47:24 +12:00
cp -f $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt $MAINDIR/fanboy-swedish.txt
2012-07-01 16:20:24 +12:00
# Wipe old files
rm -rf $MAINDIR/fanboy-swedish.txt.gz $TESTDIR/fanboy-swe.patch
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/fanboy-swedish.txt.gz $MAINDIR/fanboy-swedish.txt > /dev/null
# Create a log
FILE="$MAINDIR/fanboy-swedish.txt"
echo $ECHORESPONSE >> $LOGFILE
# Combine Regional trackers
$GOOGLEDIR/scripts/combine/firefox-adblock-intl-tracking.sh
2011-06-12 14:57:18 +12:00
# Combine
$GOOGLEDIR/scripts/combine/firefox-adblock-swe.sh
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: fanboy-swedish.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "Not updated: fanboy-swedish.txt"
### echo "SSLMAIN: $MAINDIR/fanboy-swedish.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/firefox-regional/fanboy-adblocklist-swe.txt $SSLGOOGLE"
### ls -al $GOOGLEDIR/other/adblock-gannett.txt $MAINDIR/adblock-gannett.txt
2011-04-18 13:47:24 +12:00
fi
# Gannett
2012-03-17 18:09:05 +13:00
# Hash googlecode (SSLGOOGLE) and fanboy.co.nz (SSLMAIN), then compare the two.
2012-03-16 22:40:12 +13:00
#
2012-03-17 19:43:15 +13:00
SSLGOOGLE=$($SHA256SUM $GOOGLEDIR/other/adblock-gannett.txt | cut -d' ' -f1)
SSLMAIN=$($SHA256SUM $MAINDIR/adblock-gannett.txt | cut -d' ' -f1)
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Before Loop"
### echo "SSLMAIN: $MAINDIR/adblock-gannett.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/other/adblock-gannett.txt $SSLGOOGLE"
### ls -al $GOOGLEDIR/other/adblock-gannett.txt $MAINDIR/adblock-gannett.txt
2012-03-17 20:09:32 +13:00
if [ "$SSLGOOGLE" != "$SSLMAIN" ]
then
2012-03-17 18:09:05 +13:00
## DEBUG
### echo "Updated: fanboy-gannett.txt"
### echo "SSLMAIN: $MAINDIR/adblock-gannett.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/other/adblock-gannett.txt $SSLGOOGLE"
### ls -al $GOOGLEDIR/other/adblock-gannett.txt $MAINDIR/adblock-gannett.txt
# Log
echo "Updated fanboy-gannett.txt (script: list-grabber.sh) on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
2012-03-17 18:09:05 +13:00
cp -f $GOOGLEDIR/other/adblock-gannett.txt $MAINDIR/adblock-gannett.txt
# Properly wipe old file.
2012-03-17 18:09:05 +13:00
$SHRED -n 3 -z -u $MAINDIR/adblock-gannett.txt.gz
2011-04-18 13:47:24 +12:00
$ZIP a -mx=9 -y -tgzip $MAINDIR/adblock-gannett.txt.gz $MAINDIR/adblock-gannett.txt > /dev/null
else
2012-03-17 18:09:05 +13:00
echo "Files are the same: adblock-gannett.txt" > /dev/null
## DEBUG
### echo Not Processed
### echo "Not updated: fanboy-gannett.txt"
### echo "SSLMAIN: $MAINDIR/adblock-gannett.txt $SSLMAIN"
### echo "SSLGOOGLE: $GOOGLEDIR/other/adblock-gannett.txt $SSLGOOGLE"
### ls -al $GOOGLEDIR/other/adblock-gannett.txt $MAINDIR/adblock-gannett.txt
2011-04-18 13:47:24 +12:00
fi
2012-04-01 14:43:22 +12:00
# echo when script is finished
#
echo "Script finished executing on `date +'%Y-%m-%d %H:%M:%S'`" >> $LOGFILE2
echo "------------------------- End of script -------------------------" >> $LOGFILE2
echo " " >> $LOGFILE2
$NICE $TAIL -n 6000 $LOGFILE2 > /var/www/adblock.log