Created
April 5, 2016 19:32
-
-
Save poundbangbash/f581bfcaf8e0c7a4f454ece6fcba931a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Delete all custom CUSTOMPHRASE additions every time this is run | |
awk '!/#CUSTOMPHRASE/' /etc/hosts > /tmp/hosts && cp -f /tmp/hosts /etc/hosts | |
sleep 1 | |
#Add current CUSTOMPHRASE custom additions to /etc/hosts | |
echo "#CUSTOMPHRASE Location File Server Header" >> /etc/hosts | |
echo "192.168.0.1 myserver.example.com #CUSTOMPHRASE" >> /etc/hosts | |
echo "192.168.0.2 herserver.example.com #CUSTOMPHRASE" >> /etc/hosts | |
echo "#CUSTOMPHRASE Other Server Header" >> /etc/hosts | |
echo "10.0.0.3 hisserver.example.com #CUSTOMPHRASE" >> /etc/hosts | |
echo "10.0.0.4 ourserver.example.com #CUSTOMPHRASE" >> /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment