#!/usr/bin/perl
#
# Login to the nodes and setup Bluetooth
#

# MAC of the master node
$mac='00:0A:3A:53:D4:82';
print "Master MAC address $mac \n";

system("ssh root\@node1-10 pand --listen -role NAP --master --autozap");
print "ssh root\@node1-10 pand --listen -role NAP --master --autozap \n";
sleep 10;

system("ssh root\@node4-10 pand --connect $mac --service NAP --autozap");
print "ssh root\@node4-10 pand --connect $mac --service NAP --autozap \n";
sleep 10;

system("ssh root\@node4-10 ifconfig bnep0 192.169.1.2; exit");
print "ssh root\@node4-10 ifconfig bnep0 192.169.1.2; exit \n";

system("ssh root\@node1-10 ifconfig bnep0 192.169.1.1; exit");
print "ssh root\@node1-10 ifconfig bnep0 192.169.1.1; exit \n";
