Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdargon committed Feb 9, 2022
1 parent a964c01 commit 5a46e95
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 7,050 deletions.
4 changes: 2 additions & 2 deletions filters/adservers-all.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! Title: hostsVN
! Description: Filter contains all ad networks and tracking frequently accessed.
! Last modified: 05 Feb 2022 11:11 UTC+7
! Version: 2202051111
! Last modified: 09 Feb 2022 16:34 UTC+7
! Version: 2202091634
! Blocked: 6.926 rules
! Expires: 1 days (update frequency)
! Homepage: https://bigdargon.github.io/hostsVN/
Expand Down
4 changes: 2 additions & 2 deletions filters/adservers.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! Title: hostsVN
! Description: The filter contains ad and tracking networks in Vietnam.
! Last modified: 05 Feb 2022 11:11 UTC+7
! Version: 2202051111
! Last modified: 09 Feb 2022 16:34 UTC+7
! Version: 2202091634
! Blocked: 1.063 rules
! Expires: 1 days (update frequency)
! Homepage: https://bigdargon.github.io/hostsVN/
Expand Down
4 changes: 2 additions & 2 deletions filters/domain-adservers-all.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Title: hostsVN
! Last modified: 05 Feb 2022 11:11 UTC+7
! Version: 2202051111
! Last modified: 09 Feb 2022 16:34 UTC+7
! Version: 2202091634
! Blocked: 6.926 domains
! The section containing the list contains all ad networks and tracking
!
Expand Down
4 changes: 2 additions & 2 deletions hosts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Title: hostsVN
# Last modified: 05 Feb 2022 11:11 UTC+7
# Version: 2202051111
# Last modified: 09 Feb 2022 16:34 UTC+7
# Version: 2202091634
# Blocked: 15.289 domains
# Please report any ads or problems on GitHub
# Homepage: https://bigdargon.github.io/hostsVN/
Expand Down
6 changes: 1 addition & 5 deletions makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ sed -e "s/_time_stamp_/$TIME_STAMP/g" -e "s/_version_/$VERSION/g" -e "s/_rule_vn
sed -e "s/_time_stamp_/$TIME_STAMP/g" -e "s/_version_/$VERSION/g" -e "s/_rule_/$RULE/g" tmp/title-domain.txt > tmp/title-domain.tmp
sed -e "s/!_hostname_/$HOSTNAME/g" tmp/title-config-surge.txt > tmp/title-config-surge.tmp
sed -e "s/!_hostname_/$HOSTNAME/g" tmp/title-config-surge.txt | grep -v '#!' > option/hostsVN-surge-pro.conf
sed -e "s/!_hostname_/$HOSTNAME/g" tmp/title-config-shadowrocket.txt > option/hostsVN-shadowrocket.conf
sed -e "s/!_hostname_/$HOSTNAME/g" tmp/title-config-loon.txt > option/hostsVN-loon.conf

echo "Creating hosts file..."
Expand Down Expand Up @@ -56,18 +57,14 @@ cat source/config-rule.txt | awk '{print "HOST-KEYWORD,"$1",REJECT"}' > option/h
cat tmp/adservers.tmp tmp/adservers-all.tmp | awk '{print "HOST-SUFFIX,"$1",REJECT"}' >> option/hostsVN-quantumult-rule.conf
cat source/config-rule.txt | awk '{print "DOMAIN-KEYWORD,"$1}' > option/hostsVN-surge-rule.conf
cat tmp/adservers.tmp tmp/adservers-all.tmp | awk '{print "DOMAIN-SUFFIX,"$1}' >> option/hostsVN-surge-rule.conf
cat source/config-rule.txt | awk '{print "DOMAIN-KEYWORD,"$1",REJECT"}' > tmp/shadowrocket-rule.tmp
cat tmp/adservers.tmp tmp/adservers-all.tmp | awk '{print "DOMAIN-SUFFIX,"$1",REJECT"}' >> tmp/shadowrocket-rule.tmp

# create exceptions rule
cat tmp/exceptions.tmp | awk '{print "HOST,"$1",DIRECT"}' > option/hostsVN-quantumult-exceptions-rule.conf
cat tmp/exceptions.tmp | awk '{print "DOMAIN,"$1}' > option/hostsVN-surge-exceptions-rule.conf
cat tmp/exceptions.tmp | awk '{print "DOMAIN,"$1",DIRECT"}' >> tmp/shadowrocket-exceptions-rule.tmp

echo "Creating rewrite file..."
# create rewrite
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1}' > option/hostsVN-quantumult-rejection.conf
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1" reject"}' > tmp/rewrite-shadowrocket.tmp
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print "URL-REGEX,"$1}' > option/hostsVN-surge-rewrite.conf
cat source/config-hostname.txt > option/hostsVN-quantumultX-rewrite.conf
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1" url reject-img"}' >> option/hostsVN-quantumultX-rewrite.conf
Expand All @@ -77,7 +74,6 @@ echo "Creating config file..."
# create config
sed -e "s/_time_stamp_/$TIME_STAMP/g" tmp/title-config-quantumultX.txt > option/hostsVN-quantumultX.conf
sed -e "s/!_hostname_/$HOSTNAME/g" -e '/!_rejection_quantumult_/r option/hostsVN-quantumult-rejection.conf' -e '/!_rejection_quantumult_/d' -e '/!_rule_quantumult_/r option/hostsVN-quantumult-rule.conf' -e '/!_rule_quantumult_/d' -e '/!_rule_exceptions_quantumult_/r option/hostsVN-quantumult-exceptions-rule.conf' -e '/!_rule_exceptions_quantumult_/d' tmp/title-config-quantumult.txt > option/hostsVN-quantumult.conf
sed -e "s/!_hostname_/$HOSTNAME/g" -e '/!_rewrite_shadowrocket_/r tmp/rewrite-shadowrocket.tmp' -e '/!_rewrite_shadowrocket_/d' -e '/!_rule_shadowrocket_/r tmp/shadowrocket-rule.tmp' -e '/!_rule_shadowrocket_/d' -e '/!_rule_exceptions_shadowrocket_/r tmp/shadowrocket-exceptions-rule.tmp' -e '/!_rule_exceptions_shadowrocket_/d' tmp/title-config-shadowrocket.txt > option/hostsVN-shadowrocket.conf

echo "Adding to file..."
# add to files
Expand Down
4 changes: 2 additions & 2 deletions option/hosts-VN
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Title: hostsVN
# Last modified: 05 Feb 2022 11:11 UTC+7
# Version: 2202051111
# Last modified: 09 Feb 2022 16:34 UTC+7
# Version: 2202091634
# Blocked: 1.705 domains
# Only include advertisers in Vietnam
# Homepage: https://bigdargon.github.io/hostsVN/
Expand Down
4 changes: 2 additions & 2 deletions option/hosts-gambling
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Title: hostsVN Gambling
# Last modified: 05 Feb 2022 11:11 UTC+7
# Version: 2202051111
# Last modified: 09 Feb 2022 16:34 UTC+7
# Version: 2202091634
# Blocked: 3.251 domains
# Only include gambling domains
# Homepage: https://bigdargon.github.io/hostsVN/
Expand Down
4 changes: 2 additions & 2 deletions option/hosts-iOS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Title: hostsVN
# Last modified: 05 Feb 2022 11:11 UTC+7
# Version: 2202051111
# Last modified: 09 Feb 2022 16:34 UTC+7
# Version: 2202091634
# Blocked: 15.289 domains
# Minimal version for iOS. Please report any ads or problems on GitHub
# Homepage: https://bigdargon.github.io/hostsVN/
Expand Down
2 changes: 1 addition & 1 deletion option/hostsVN-quantumultX.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 05 Feb 2022 11:11
# 09 Feb 2022 16:34
[general]
udp_whitelist=53, 1024-65535

Expand Down
Loading

0 comments on commit 5a46e95

Please sign in to comment.