Skip to content

Instantly share code, notes, and snippets.

@marc-hanheide
Last active August 29, 2015 14:02
Show Gist options
  • Save marc-hanheide/28e949b468c06465f340 to your computer and use it in GitHub Desktop.
Save marc-hanheide/28e949b468c06465f340 to your computer and use it in GitHub Desktop.
to set the ROS_HOSTNAME from a ppp address in an /etc/hosts file
export ROS_HOSTNAME=`grep \`ifconfig | grep -A1 ppp | grep inet | cut -f2 -d:| cut -f1 -d" "\` /etc/hosts | tr -s " " | cut -f2 -d " "`
echo "ROS_HOSTNAME set to $ROS_HOSTNAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment