We have a script that downloads a list of domains for our squid box to block, but we keep getting warnings like the following:
2015/03/02 17:08:47| WARNING: You should probably remove '.artnau.com' from the ACL named 'chat_domains'
2015/03/02 17:08:47| WARNING: '.artnau.com' is a subdomain of '.css.artnau.com'
2015/03/02 17:08:47| WARNING: because of this '.css.artnau.com' is ignored to keep splay tree searching predictable
2015/03/02 17:08:47| WARNING: You should probably remove '.artnau.com' from the ACL named 'chat_domains'
2015/03/02 17:08:47| WARNING: '.chatserve.com' is a subdomain of '.eagles.chatserve.com'
2015/03/02 17:08:47| WARNING: because of this '.eagles.chatserve.com' is ignored to keep splay tree searching predictable
Is there any way to go through the file, and remove the subdomains from existing domains in the list?
So grab the first line and check to see if there are any other lines in the text that end with that text and remove it?