Skip to content

Instantly share code, notes, and snippets.

@leogdion
Last active January 2, 2016 00:59
Show Gist options
  • Save leogdion/8226872 to your computer and use it in GitHub Desktop.
Save leogdion/8226872 to your computer and use it in GitHub Desktop.
#!/bin/sh
ipaddress=`ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -f2 -d:`
sed -e "s/^/${ipaddress} /" /usr/local/etc/hostnames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment