Commit cea32f54 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add "restart" option.

parent 39956369
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2010 University of Utah and the Flux Group. # Copyright (c) 2010-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use strict; use strict;
...@@ -14,7 +14,7 @@ use Data::Dumper; ...@@ -14,7 +14,7 @@ use Data::Dumper;
# #
sub usage() sub usage()
{ {
print STDERR "Usage: testbed-control [-d] [-f] shutdown | boot\n"; print STDERR "Usage: testbed-control [-d] [-f] shutdown | boot | restart\n";
exit(-1); exit(-1);
} }
my $optlist = "df"; my $optlist = "df";
...@@ -64,7 +64,8 @@ if (defined($options{"f"})) { ...@@ -64,7 +64,8 @@ if (defined($options{"f"})) {
usage() usage()
if (@ARGV != 1); if (@ARGV != 1);
usage() usage()
if (! ($ARGV[0] eq "boot" || $ARGV[0] eq "shutdown")); if (! ($ARGV[0] eq "boot" || $ARGV[0] eq "shutdown" ||
$ARGV[0] eq "restart"));
# #
# Must be root if actually doing this. # Must be root if actually doing this.
...@@ -178,6 +179,12 @@ if (defined($activeimages)) { ...@@ -178,6 +179,12 @@ if (defined($activeimages)) {
} }
} }
} }
if ($ARGV[0] eq "restart") {
print "** Testbed is stopped. Waiting a moment before restarting ...\n";
sleep(2);
Restart();
exit(0);
}
print "** Testbed is stopped. Safe to power off or reboot\n"; print "** Testbed is stopped. Safe to power off or reboot\n";
exit(0); exit(0);
......
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