Commit a45e4970 authored by Robert Ricci's avatar Robert Ricci
Browse files

A hacky little script to get the name of the the proper 'internet'

interface  on a node in an Emulab experiment. Assumes the name of
the 'Internet' LAN is 'planetc'.
parent efe4cd2a
#!/usr/bin/sh
LINKNAME=planetc
HOSTNAME=`cat /var/emulab/boot/nickname | sed 's/\..*//'`
LINK="$HOSTNAME-$LINKNAME"
LINKIP=`grep "$LINK" /etc/hosts | cut -f1`
IFACENAME=`ifconfig -a | perl -e 'while(<>) { if (/^(eth\d+)/) { $if = $1; } if (/10.1/) { print "$if\n"; exit 0; }} exit 1;'`
echo $IFACENAME
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment