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


# slave nodes
@slaves = ("node1-2");

#foreach $currentnode (@slaves)
#{
#  system("")
#}

system("ssh root\@node10-11 pand --listen --role GN --master --autozap");
print "ssh root\@node10-11 pand --listen --role GN --master --autozap \n";
sleep 10;
system("ssh root\@node7-10 pand --connect 00:0A:3A:53:CE:B5 --role PANU --autozap");
print "ssh root\@node7-10 pand --connect 00:0A:3A:53:CE:B5 --role PANU --autozap \n";
sleep 10;

system("ssh root\@node14-15 pand --listen --role GN --master --autozap");
print "ssh root\@node14-15 pand --listen --role GN --master --autozap \n";
sleep 10;
system("ssh root\@node18-18 pand --connect 00:0A:3A:53:D0:F2 --role PANU --autozap");
print "ssh root\@node18-18 pand --connect 00:0A:3A:53:D0:F2 --role PANU --autozap \n";
sleep 10;

system("ssh root\@node13-8 pand --listen --role GN --master --autozap");
print "ssh root\@node13-8 pand --listen --role GN --master --autozap \n";
sleep 10;
system("ssh root\@node14-10 pand --connect 00:0A:3A:53:D0:F8 --role PANU --autozap");
print "ssh root\@node14-10 pand --connect 00:0A:3A:53:D0:F8 --role PANU --autozap \n";
sleep 10;

system("ssh root\@node13-10 pand --listen --role GN --master --autozap");
print "ssh root\@node13-10 pand --listen --role GN --master --autozap \n";
sleep 10;
system("ssh root\@node15-9 pand --connect 00:0A:3A:53:D4:82--role PANU --autozap");
print "ssh root\@node15-9 pand --connect 00:0A:3A:53:D4:82 --role PANU --autozap \n";
sleep 10;

system("ssh root\@node1-10 pand --listen --role GN --master --autozap");
print "ssh root\@node1-10pand --listen --role GN --master --autozap \n";
sleep 10;
system("ssh root\@node4-10 pand --connect 00:0A:3A:53:D5:D8 --role PANU --autozap");
print "ssh root\@node4-10 pand --connect 00:0A:3A:53:D5:D8 --role PANU --autozap \n";
sleep 10;

system("ssh root\@node10-11 ifconfig bnep0 192.170.10.11 netmask 255.255.0.0; exit");
print "ssh root\@node10-11 ifconfig bnep0 192.170.10.11 netmask 255.255.0.0; exit \n";
system("ssh root\@node7-10 ifconfig bnep0 192.170.7.10 netmask 255.255.0.0; exit");
print "ssh root\@node7-10 ifconfig bnep0 192.170.7.10 netmask 255.255.0.0; exit \n";

system("ssh root\@node14-15 ifconfig bnep0 192.171.14.15 netmask 255.255.0.0; exit");
print "ssh root\@node14-15 ifconfig bnep0 192.171.14.15 netmask 255.255.0.0; exit \n";
system("ssh root\@node18-18 ifconfig bnep0 192.171.18.18 netmask 255.255.0.0; exit");
print "ssh root\@node18-18 ifconfig bnep0 192.171.18.18 netmask 255.255.0.0; exit \n";

system("ssh root\@node13-8 ifconfig bnep0 192.172.13.8 netmask 255.255.0.0; exit");
print "ssh root\@node13-8 ifconfig bnep0 192.172.13.8 netmask 255.255.0.0; exit \n";
system("ssh root\@node14-10 ifconfig bnep0 192.172.14.10 netmask 255.255.0.0; exit");
print "ssh root\@node14-10 ifconfig bnep0 192.172.14.10 netmask 255.255.0.0; exit \n";

system("ssh root\@node13-10 ifconfig bnep0 192.173.13.10 netmask 255.255.0.0; exit");
print "ssh root\@node13-10 ifconfig bnep0 192.173.13.10 netmask 255.255.0.0; exit \n";
system("ssh root\@node15-9 ifconfig bnep0 192.173.15.9 netmask 255.255.0.0; exit");
print "ssh root\@node15-9 ifconfig bnep0 192.173.15.9 netmask 255.255.0.0; exit \n";

system("ssh root\@node1-10 ifconfig bnep0 192.174.1.10 netmask 255.255.0.0; exit");
print "ssh root\@node1-10 ifconfig bnep0 192.174.1.10 netmask 255.255.0.0; exit \n";
system("ssh root\@node4-10 ifconfig bnep0 192.174.4.10 netmask 255.255.0.0; exit");
print "ssh root\@node4-10 ifconfig bnep0 192.174.4.10 netmask 255.255.0.0; exit \n";

