Commit 38055b76 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Minor change to usage statement.

Add explicit -w option to wait for node to reboot.
parent 52f1e2b8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group. # Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -14,12 +14,13 @@ use Getopt::Std; ...@@ -14,12 +14,13 @@ use Getopt::Std;
# #
sub usage() sub usage()
{ {
print STDOUT "Usage: nodeadmin [-h] [-n] <on | off> <node>\n"; print STDOUT "Usage: nodeadmin [-h] [-n | -w] <on | off> <node>\n";
print STDOUT "-h This message\n"; print STDOUT "-h This message\n";
print STDOUT "-n Don't reboot nodes\n"; print STDOUT "-n Do not reboot node\n";
print STDOUT "-w Wait for node to come back up if rebooted\n";
exit(-1); exit(-1);
} }
my $optlist = "hn"; my $optlist = "hnw";
# #
# Configure variables # Configure variables
...@@ -121,7 +122,9 @@ DBQueryFatal("update nodes set startupcmd='', startstatus='none' ". ...@@ -121,7 +122,9 @@ DBQueryFatal("update nodes set startupcmd='', startstatus='none' ".
# Reboot node # Reboot node
# #
if (!$options{n}) { if (!$options{n}) {
if (system("$nodereboot", "$node")) { my $optarg = ($options{"w"} ? "-w" : "");
if (system("$nodereboot $optarg $node")) {
die("*** $0:\n". die("*** $0:\n".
" WARNING: Could not reboot $node.\n"); " WARNING: Could not reboot $node.\n");
} }
......
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