I am trying to create a .sh script that checks if some IP/Domain like "teamspeak.com" exists in /etc/hosts and if it does not then I want to add something to the hosts file.
Right now I am trying this with:
if ! grep -q "teamspeak.com == teamspeak.com" /etc/hosts; then
echo "Exists"
else
echo "Add to etc host ting here" >> /etc/hosts;
fi