summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2017-06-24 20:27:16 -0500
committerKyle K <kylek389@gmail.com>2017-06-24 20:27:16 -0500
commit9f349bc53b85ecdb8482c5c0cb7671d22426d74a (patch)
tree527ec2e2adbd563888c6de0e75505b7d1ba9459f
parent7b028960b478d1c8d6512419aee783da1fca9121 (diff)
downloadscripts-9f349bc53b85ecdb8482c5c0cb7671d22426d74a.tar.gz
scripts-9f349bc53b85ecdb8482c5c0cb7671d22426d74a.tar.bz2
scripts-9f349bc53b85ecdb8482c5c0cb7671d22426d74a.zip
prevent domain dupes in hostfile block script
-rwxr-xr-xhostfile-block.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/hostfile-block.sh b/hostfile-block.sh
index 6833168..6971da8 100755
--- a/hostfile-block.sh
+++ b/hostfile-block.sh
@@ -86,7 +86,7 @@ if ping -q -c 1 -W 1 cs.uic.edu >/dev/null; then
truncate -s 0 /etc/hosts
cat $base_host_file >> /etc/hosts
- cat $blocklist_tmp | sed $'s/\r$//' | sort -u | sed '/^$/d' | awk -v "IP=$destination_ip" '{sub(/\r$/,""); print IP" "$0}' >> /etc/hosts
+ cat $blocklist_tmp | sed $'s/\r$//' | sort -u | sed '/^$/d' | awk -v "IP=$destination_ip" '{sub(/\r$/,""); print IP" "$0}' | uniq >> /etc/hosts
rm -f $blocklist_tmp