Last active
August 29, 2015 14:05
-
-
Save michel-zimmer/0d0e0f297f3c3a3835c0 to your computer and use it in GitHub Desktop.
/etc/network/if-up.d/homenetwork
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/sh | |
# replace _mac_ with a mac adress of an always on network device, like a router | |
if [ $( /usr/sbin/arp -a | grep -c '_mac_' ) -eq 1 ]; then | |
cat /etc/hosts.homenetwork > /etc/hosts | |
else | |
cat /etc/hosts.publicnetwork > /etc/hosts | |
fi | |
cat /etc/hosts.default >> /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment