Skip to content

Commit

Permalink
Merge pull request #14 from Pandoriaantje/master
Browse files Browse the repository at this point in the history
fix da script
  • Loading branch information
Andrwe authored Jan 8, 2022
2 parents e414ad7 + 052ee87 commit 8758051
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions privoxy-blocklist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function main()
debug "... creating filterfile for ${list} ..." 1
echo "FILTER: ${list} Tag filter of ${list}" > ${filterfile}
# set filter for html elements
sed '/^#/!d;s/^##//g;s/^#\(.*\)\[.*\]\[.*\]*/s@<([a-zA-Z0-9]+)\\s+.*id=.?\1.*>.*<\/\\1>@@g/g;s/^#\(.*\)/s@<([a-zA-Z0-9]+)\\s+.*id=.?\1.*>.*<\/\\1>@@g/g;s/^\.\(.*\)/s@<([a-zA-Z0-9]+)\\s+.*class=.?\1.*>.*<\/\\1>@@g/g;s/^a\[\(.*\)\]/s@<a.*\1.*>.*<\/a>@@g/g;s/^\([a-zA-Z0-9]*\)\.\(.*\)\[.*\]\[.*\]*/s@<\1.*class=.?\2.*>.*<\/\1>@@g/g;s/^\([a-zA-Z0-9]*\)#\(.*\):.*[:[^:]]*[^:]*/s@<\1.*id=.?\2.*>.*<\/\1>@@g/g;s/^\([a-zA-Z0-9]*\)#\(.*\)/s@<\1.*id=.?\2.*>.*<\/\1>@@g/g;s/^\[\([a-zA-Z]*\).=\(.*\)\]/s@\1^=\2>@@g/g;s/\^/[\/\&:\?=_]/g;s/\.\([a-zA-Z0-9]\)/\\.\1/g' ${file} >> ${filterfile}
sed '/^#/!d;s/^##//g;s/^#\(.*\)\[.*\]\[.*\]*/s@<([a-zA-Z0-9]+)\\s+.*id=.?\1.*>.*<\/\\1>@@g/g;s/^#\(.*\)/s@<([a-zA-Z0-9]+)\\s+.*id=.?\1.*>.*<\/\\1>@@g/g;s/^\.\(.*\)/s@<([a-zA-Z0-9]+)\\s+.*class=.?\1.*>.*<\/\\1>@@g/g;s/^a\[\(.*\)\]/s@<a.*\1.*>.*<\/a>@@g/g;s/^\([a-zA-Z0-9]*\)\.\(.*\)\[.*\]\[.*\]*/s@<\1.*class=.?\2.*>.*<\/\1>@@g/g;s/^\([a-zA-Z0-9]*\)#\(.*\):.*[\:[^:]]*[^:]*/s@<\1.*id=.?\2.*>.*<\/\1>@@g/g;s/^\([a-zA-Z0-9]*\)#\(.*\)/s@<\1.*id=.?\2.*>.*<\/\1>@@g/g;s/^\[\([a-zA-Z]*\).=\(.*\)\]/s@\1^=\2>@@g/g;s/\^/[\/\&:\?=_]/g;s/\.\([a-zA-Z0-9]\)/\\.\1/g' ${file} >> ${filterfile}
debug "... filterfile created - adding filterfile to actionfile ..." 1
echo "{ +filter{${list}} }" >> ${actionfile}
echo "*" >> ${actionfile}
Expand Down Expand Up @@ -151,7 +151,7 @@ function main()

# install Privoxy filterfile
install -o ${PRIVOXY_USER} -g ${PRIVOXY_GROUP} ${VERBOSE} ${filterfile} ${PRIVOXY_DIR}
if $(grep $(basename ${filterfile}) ${PRIVOXY_CONF})
if [ "$(grep $(basename ${filterfile}) ${PRIVOXY_CONF})" == "" ]
then
debug "\nModifying ${PRIVOXY_CONF} ..." 0
sed "s/^\(#*\)filterfile user\.filter/filterfile $(basename ${filterfile})\n\1filterfile user.filter/" ${PRIVOXY_CONF} > ${TMPDIR}/config
Expand All @@ -172,7 +172,7 @@ then
# array of URL for AdblockPlus lists
# for more sources just add it within the round brackets
URLS=(\"https://easylist-downloads.adblockplus.org/easylistgermany.txt\" \"http://adblockplus.mozdev.org/easylist/easylist.txt\")
URLS=(\"https://easylist-downloads.adblockplus.org/easylistgermany.txt\" \"https://easylist-downloads.adblockplus.org/easylist.txt\")
# config for privoxy initscript providing PRIVOXY_CONF, PRIVOXY_USER and PRIVOXY_GROUP
INIT_CONF=\"/etc/conf.d/privoxy\"
Expand Down

0 comments on commit 8758051

Please sign in to comment.