#!/bin/sh export NETIO_NETMAP=/mnt/sda1/IOU/NETMAP /mnt/sda1/IOU/netmap.pl local_id=$(echo `head -n 1 /mnt/sda1/IOU/NETMAP` | cut -d ":" -f1) remote_id=$(echo `head -n 1 /mnt/sda1/IOU/NETMAP` | cut -d ":" -f2 | cut -d " " -f2) cd /mnt/sda1/IOU/ /mnt/sda1/IOU/wrapper -m /mnt/sda1/IOU/i86bi_linux_l2-ipbasek9-ms.may8-2013-team_track -p 6000 -- -e 4 -s 0 $local_id & sleep 5 for dir in /sys/class/net/*; do interface=$(echo $dir | cut -d "/" -f5) string=${interface:0:3} if [[ "$string" == eth ]]; then lastchr=${interface#${interface%?}} /usr/local/sbin/tunctl -t tap$lastchr /sbin/ifconfig $interface 0.0.0.0 promisc up /sbin/ifconfig tap$lastchr 0.0.0.0 promisc up /usr/local/sbin/brctl addbr br$lastchr /usr/local/sbin/brctl stp br$lastchr off /usr/local/sbin/brctl setfd br$lastchr 1 /usr/local/sbin/brctl sethello br$lastchr 1 /usr/local/sbin/brctl addif br$lastchr $interface /usr/local/sbin/brctl addif br$lastchr tap$lastchr /sbin/ifconfig br$lastchr up /mnt/sda1/IOU/iou2net.pl -t tap$lastchr -n /mnt/sda1/IOU/NETMAP -p $remote_id & remote_id=$(expr $remote_id + 1) fi done