Cheat Sheets

Network - No entries in /etc/hosts

Description

Ensures that there are no extra entries in /etc/hosts

Check Script: network-empty-hosts.sh

output=$(cat /etc/hosts | egrep -v "localhost|$HOSTNAME|^#|ip6|^ *$")
if [ "$output" != "" ]; then
	result_failed "Unexpected entries in /etc/hosts: $output"
fi
Comment on Disqus