Skip to content

Commit

Permalink
Use while loop over for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamm00 committed Oct 31, 2017
1 parent e2143e3 commit b16de03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1262,12 +1262,12 @@ case "$1" in
Whitelist_Shared >/dev/null 2>&1 && echo "[$(($(date +%s) - btime))s]"
btime="$(date +%s)" && printf "Consolidating Blacklist "
mkdir -p /tmp/skynet
cd /tmp/skynet
for domain in $(cat /jffs/shared-Skynet-whitelist); do
cd /tmp/skynet || exit 1
while IFS= read -r "domain"; do
/usr/sbin/curl -fs "$domain" -O &
done
done < /jffs/shared-Skynet-whitelist
wait
cd "$home"
cd /tmp/home/root || exit 1
cat /tmp/skynet/* | sed -n "s/\\r//;/^$/d;/^[0-9,\\.,\\/]*$/p" | awk '!x[$0]++' | Filter_PrivateIP > /tmp/malwarelist.txt && echo "[$(($(date +%s) - btime))s]"
btime="$(date +%s)" && printf "Filtering IPv4 Addresses "
grep -vF "/" /tmp/malwarelist.txt | awk '{print "add Blacklist " $1 " comment BanMalware"}' > "/tmp/malwarelist2.txt" && echo "[$(($(date +%s) - btime))s]"
Expand Down

0 comments on commit b16de03

Please sign in to comment.