micahflee/fixubuntu

modifying /etc/hosts

atrent opened this issue · 1 comments

I'd like to suggest a small modification to the lines modifying /etc/hosts, instead of just:

echo | sudo tee -a /etc/hosts; echo 127.0.0.1 productsearch.ubuntu.com | sudo tee -a /etc/hosts

enclose it in an "if", something like:

if
grep -q productsearch.ubuntu.com /etc/hosts
then
echo | sudo tee -a /etc/hosts; echo 127.0.0.1 productsearch.ubuntu.com | sudo tee -a /etc/hosts
fi

so that multiple executions of the same script (e.g. when re-cleaning an installation) do not append multiple lines to the file

Good call, I've just finished this.