Statistics
| Branch: | Revision:

wcn_emulator / attachto.sh @ master

History | View | Annotate | Download (291 Bytes)

1
#!/usr/bin/env bash
2

    
3
if [ $# -ne 1 ]; then
4
	echo "Usage: $0 <host name (e.g., h0_0)>"
5
	exit 1
6
fi
7

    
8
hn=$1
9
pid=`ps aux | grep mininet:${hn} | grep -v grep | sed -e "s/  */ /g" | cut -d' ' -f 2`
10
if [ "${pid}" == "" ]; then
11
	echo "No host named ${hn} found"
12
	exit 1
13
fi
14
sudo mnexec -a ${pid} bash