Skip to content

Commit 80c7d9f

Browse files
authored
Update host.sh
1 parent 481b8b8 commit 80c7d9f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

host.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ rm -f host adblocker dnsmasq.conf smartdns.conf domain clash allow
88

99
# Merge allowlist
1010
echo "Merge allow..."
11-
for url in `cat allowlist` ; do
11+
while read -r url; do
12+
[[ -z "$url" || "$url" =~ ^# ]] && continue # Skip empty lines and comments
1213
wget --no-check-certificate -t 1 -T 10 -q -O - "$url" >> tmpallow
13-
done
14+
done < allowlist
1415

1516
sed -i -e '/#/d' \
1617
-e '/^$/d' \
@@ -25,9 +26,10 @@ rm -f tmpallow
2526

2627
# Merge blocklist
2728
echo "Merge block..."
28-
for url in `cat blocklist` ; do
29+
while read -r url; do
30+
[[ -z "$url" || "$url" =~ ^# ]] && continue # Skip empty lines and comments
2931
wget --no-check-certificate -t 1 -T 10 -q -O - "$url" >> tmpblock
30-
done
32+
done < blocklist
3133

3234
sed -i -e '/#/d' \
3335
-e '/@/d' \

0 commit comments

Comments
 (0)