Created
October 25, 2013 17:06
-
-
Save nqn/7158140 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 | |
ip=`ifconfig eth0|grep -o -e "inet addr:[0-9\.]*"|sed 's/.*://g'` | |
name=`hostname` | |
echo $ip $name >> /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment