Skip to content

Instantly share code, notes, and snippets.

@doublejosh
Forked from angrytoast/omghosts
Last active August 29, 2015 13:59
Show Gist options
  • Save doublejosh/10502295 to your computer and use it in GitHub Desktop.
Save doublejosh/10502295 to your computer and use it in GitHub Desktop.
Never accidentally leave your /etc/hosts file edited again!!! Let your computer remind you.
#! /usr/bin/env bash
GOLDEN_DOMAIN="example.com"
PROBLEM="$(cat /etc/hosts | grep $GOLDEN_DOMAIN | grep -v '^#' | wc -w)"
if [ "$PROBLEM" -gt 0 ]; then
say omg fix yer hosts
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment