summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob van der Kolk2017-08-03 11:17:45 -0400
committerJacob van der Kolk2017-08-03 11:17:45 -0400
commit879f60fd802d9aa8381558b36e068868a395a5e0 (patch)
tree7b54873df18cace176f6c3b428f52d53a5e6fdc0
parentddc82f30345dede90a3a6d79613bfda9859a57d0 (diff)
downloadaur-879f60fd802d9aa8381558b36e068868a395a5e0.tar.gz
Version 0.999.6-1 (Alpha 6)
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD15
-rw-r--r--hostsblock.changelog6
-rw-r--r--hostsblock.install5
-rwxr-xr-xhostsblock.sh29
5 files changed, 40 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9c812f9991d9..015713afc1f7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = hostsblock
pkgdesc = A script that downloads, sorts, and compiles multiple ad- and malware-blocking hosts files.
- pkgver = 0.999.5
+ pkgver = 0.999.6
pkgrel = 1
url = http://gaenserich.github.com/hostsblock/
install = hostsblock.install
@@ -30,7 +30,7 @@ pkgbase = hostsblock
source = hosts.head
source = hostsblock.service
source = hostsblock.timer
- sha1sums = 798fe7d07a9fab689c44243b025f4bfa4da345ed
+ sha1sums = 5bb46b63a3371494cbd1ccc5b955583c635267d7
sha1sums = d9db54fb078ff0e674a1f32a886ad29969830459
sha1sums = 30fdaad1ee0497b9b88b61cfbd958d20c644801b
sha1sums = 11ab0a6bac002879a04872ec06a3611c32c80e1d
diff --git a/PKGBUILD b/PKGBUILD
index 963259767a50..56ab0faa3c97 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer/Originator: Jake VanderKolk <jakevanderkolk@gmail.com>
pkgname=hostsblock
-pkgver=0.999.5
+pkgver=0.999.6
pkgrel=1
pkgdesc="A script that downloads, sorts, and compiles multiple ad- and malware-blocking hosts files."
arch=(any)
@@ -17,7 +17,7 @@ backup=('var/lib/hostsblock/hostsblock.conf' 'var/lib/hostsblock/black.list' 'va
changelog=$pkgname.changelog
install=$pkgname.install
source=('hostsblock.sh' 'hostsblock.conf' 'black.list' 'white.list' 'hosts.head' 'hostsblock.service' 'hostsblock.timer')
-sha1sums=('798fe7d07a9fab689c44243b025f4bfa4da345ed'
+sha1sums=('5bb46b63a3371494cbd1ccc5b955583c635267d7'
'd9db54fb078ff0e674a1f32a886ad29969830459'
'30fdaad1ee0497b9b88b61cfbd958d20c644801b'
'11ab0a6bac002879a04872ec06a3611c32c80e1d'
@@ -26,12 +26,13 @@ sha1sums=('798fe7d07a9fab689c44243b025f4bfa4da345ed'
'f57b1cd082e29631b6fbaae5a7191dbc3ddf176b')
package() {
- install -Dm750 "$srcdir"/hostsblock.sh "$pkgdir"/usr/bin/hostsblock
+ mkdir -p -m 750 "$pkgdir"/var/lib/hostsblock
+ install -o hostsblock -Dm750 "$srcdir"/hostsblock.sh "$pkgdir"/usr/bin/hostsblock
ln -sf /usr/bin/hostsblock "$pkgdir"/usr/bin/hostsblock-urlcheck
- install -Dm640 "$srcdir"/hostsblock.conf "$pkgdir"/var/lib/hostsblock/hostsblock.conf
- install -Dm640 "$srcdir"/black.list "$pkgdir"/var/lib/hostsblock/black.list
- install -Dm640 "$srcdir"/white.list "$pkgdir"/var/lib/hostsblock/white.list
- install -Dm640 "$srcdir"/hosts.head "$pkgdir"/var/lib/hostsblock/hosts.head
+ install -o hostsblock -Dm640 "$srcdir"/hostsblock.conf "$pkgdir"/var/lib/hostsblock/hostsblock.conf
+ install -o hostsblock -Dm640 "$srcdir"/black.list "$pkgdir"/var/lib/hostsblock/black.list
+ install -o hostsblock -Dm640 "$srcdir"/white.list "$pkgdir"/var/lib/hostsblock/white.list
+ install -o hostsblock -Dm640 "$srcdir"/hosts.head "$pkgdir"/var/lib/hostsblock/hosts.head
install -Dm640 "$srcdir"/hostsblock.service "$pkgdir"/usr/lib/systemd/system/hostsblock.service
install -Dm640 "$srcdir"/hostsblock.timer "$pkgdir"/usr/lib/systemd/system/hostsblock.timer
}
diff --git a/hostsblock.changelog b/hostsblock.changelog
index 3d6f3515493f..5f5ece588034 100644
--- a/hostsblock.changelog
+++ b/hostsblock.changelog
@@ -1,5 +1,11 @@
See https://github.com/gaenserich/hostsblock/commits/master for a complete list of updates
+Version 0.999.6 (Alpha 6) (03.08.2017)
+*Fixed parsing function that falsely expected gzip
+*Fixed verbosity typo
+*Fixed issue with hostsblock-urlblock symlink not reading from $1
+*Moved raw annotation file to cache space to improve performance and reduce non-transitory space requirements
+
Version 0.999.5 (Alpha 5) (01.08.2017)
*Fixed issues with hostsblock-urlblock symlink
*Fixed typo that prevented the annotation file from correctly writing
diff --git a/hostsblock.install b/hostsblock.install
index cea01f46a539..40772fb4d56d 100644
--- a/hostsblock.install
+++ b/hostsblock.install
@@ -15,15 +15,12 @@ add_user_group() {
if [ $_changed == 1 ]; then
gpasswd -a hostsblock hostsblock
gpasswd -A hostsblock hostsblock
- chmod 750 /var/lib/hostsblock
- chmod -R 640 /var/lib/hostsblock/*
- chown -R hostsblock:hostsblock /var/lib/hostsblock
+ chown hostsblock:hostsblock /var/lib/hostsblock
fi
}
post_install() {
add_user_group
- chown hostsblock:hostsblock /usr/bin/hostsblock
cat << EOF
As of 0.999.4, hostsblock requires additional sudo permissions.
diff --git a/hostsblock.sh b/hostsblock.sh
index 721355bee508..5c64f93f5e73 100755
--- a/hostsblock.sh
+++ b/hostsblock.sh
@@ -98,16 +98,16 @@ _check_url() {
echo "Unblocking just $@"
echo " $@" >> "$whitelist"
_strip_entries " $@ \!" "$annotate"
- _strip_entries " $@$" "$blacklist"
- _strip_entries " $@$" "$hostsfile"
+ sed -i "/ $@$/d" "$blacklist"
+ sed -i "/ $@$/d" "$hostsfile"
[ ! -d "$tmpdir"/hostsblock ] && mkdir $_v -p "$tmpdir"/hostsblock
touch "$tmpdir"/hostsblock/changed
elif [[ $b == 2 || "$b" == "2" ]]; then
echo "Unblocking all sites containing url $@"
echo "$@" >> "$whitelist"
_strip_entries "$@" "$annotate"
- _strip_entries "$@" "$blacklist"
- _strip_entries "$@" "$hostsfile"
+ sed -i "/$@/d" "$blacklist"
+ sed -i "/$@/d" "$hostsfile"
[ ! -d "$tmpdir"/hostsblock ] && mkdir $_v -p "$tmpdir"/hostsblock
touch "$tmpdir"/hostsblock/changed
fi
@@ -129,7 +129,7 @@ _check_url() {
fi
rm -f "$_v" -- "$tmpdir"/hostsblock/"${annotate##*/}".tmp
) &
- _strip_entries "^$@$" "$whitelist" &
+ sed -i "/^$@$/d" "$whitelist" &
echo "$redirecturl $@" >> "$hostsfile" &
[ ! -d "$tmpdir"/hostsblock ] && mkdir $_v -p "$tmpdir"/hostsblock
touch "$tmpdir"/hostsblock/changed
@@ -149,7 +149,7 @@ _check_url() {
fi
rm -f "$_v" -- "$tmpdir"/hostsblock/"${annotate##*/}".tmp
) &
- _strip_entries "$@" "$whitelist" &
+ sed -i "/$@/d" "$whitelist" &
echo "$redirecturl $@" >> "$hostsfile" &
[ ! -d "$tmpdir"/hostsblock ] && mkdir $_v -p "$tmpdir"/hostsblock
touch "$tmpdir"/hostsblock/changed
@@ -290,6 +290,23 @@ if [ $_check -eq 1 ] || [ "${0##*/}" == "hostsblock-urlcheck" ]; then
postprocess &>/dev/null
fi
fi
+ read -p "Page domain verified. Scan the whole page for other domains for (un)blocking? [y/N] " a
+ if [[ $a == "y" || $a == "Y" ]]; then
+ for LINE in $(curl -L --location-trusted -s "$_URL" | tr ' ' '\n' | grep "https*:\/\/" | sed -e "s/.*https*:\/\/\(.*\)$/\1/g" \
+ -e "s/\//\n/g" | grep "\." | grep -vFe '"' -e ")" -e "(" -e "&" -e "?" -e "<" -e ">" -e "'" -e "_" | \
+ grep -Fv -e "\.php$" -e "\.html*$" | grep "[a-z]$" | sort -u | tr "\n" " "); do
+ _check_url "$LINE"
+ done
+ _notify 1 "Whole-page scan completed."
+ fi
+
+ if [ -f "$tmpdir"/hostsblock/changed ]; then
+ if [ $_verbosity -ge 1 ]; then
+ postprocess
+ else
+ postprocess &>/dev/null
+ fi
+ fi
else
# NORMAL PROCESS
# CHECK FOR OPTIONAL DECOMPRESSION DEPENDENCIES