Commit 1d1c854d authored by Sonika Jindal's avatar Sonika Jindal

Start oaisim with manual startup script

parent 616113a3
......@@ -37,8 +37,35 @@ system("apt-get install multitail");
#
# Setup ssh commands
#
#
# Display help and exit.
#
sub help() {
logprint("Usage: start_oai [-r sim]\n");
exit 1;
}
my %opts = ();
if (!getopts("r:",\%opts)) {
help();
}
my $enbStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o BatchMode=yes -o StrictHostKeyChecking=no enb1 ";
my $role = $opts{'r'};
my $simPresent = "0";
if ($role eq "sim") {
$simPresent = "1";
}
my $enbStart;
if ($simPresent == "1")
{
$enbStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o BatchMode=yes -o StrictHostKeyChecking=no sim-enb ";
}
else
{
$enbStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o BatchMode=yes -o StrictHostKeyChecking=no enb1 ";
}
my $epcStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=no epc ";
my $nickname = `$CAT $BOOTDIR/nickname`;
......@@ -60,7 +87,14 @@ print "Killing off any old services...\n";
system($epcStart . "/local/repository/bin/hss.kill.sh");
system($epcStart . "/local/repository/bin/mme.kill.sh");
system($epcStart . "/local/repository/bin/spgw.kill.sh");
if ($simPresent == "1")
{
system($enbStart . "/local/repository/bin/sim_enb.kill.sh");
}
else
{
system($enbStart . "/local/repository/bin/enb.kill.sh");
}
print "Starting HSS...\n";
system($epcStart . "/local/repository/bin/hss.start.sh");
......@@ -74,18 +108,25 @@ print "Starting SPGW...\n";
system($epcStart . "/local/repository/bin/spgw.start.sh");
sleep(30);
print "Starting ENB...\n";
my $devices = `${enbStart}lsusb`;
if ($devices =~ /2500:0020/)
if ($simPresent == "1")
{
system($enbStart . "/local/repository/bin/enb.start.sh");
print "Starting SIM ENB...\n";
system($enbStart . "/local/repository/bin/sim_enb.start.sh");
}
else
{
print "Starting ENB...\n";
my $devices = `${enbStart}lsusb`;
if ($devices =~ /2500:0020/)
{
system($enbStart . "/local/repository/bin/enb.start.sh");
}
else
{
print "ERROR: Could not detect USRP B210 radio on the enb1 node. This is usually a transient error. Reboot the enb1 node and try again.\n";
exit(1);
}
}
#
# Display Output of services
#
......
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