Skip to content

Instantly share code, notes, and snippets.

@nqn
Created October 25, 2013 17:06
Show Gist options
  • Save nqn/7158140 to your computer and use it in GitHub Desktop.
Save nqn/7158140 to your computer and use it in GitHub Desktop.
#!/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