|
From: Jason B. <br...@us...> - 2005-01-06 20:23:08
|
Update of /cvsroot/openxcat/openxcat/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1095 Added Files: rreset Log Message: Initial checkin (untested) --- NEW FILE: rreset --- #!/usr/bin/perl # rreset - Remote Reset # # Written by Jason Brechin <br...@nc...> # Copyright 2004 The Board of Trustees of the University of Illinois. # # $Id: rreset,v 1.1 2005/01/06 20:22:51 brechin Exp $ use FindBin qw($Bin); use lib "$Bin/../lib"; use openXcat::Base; use Carp; use Switch; if ( scalar(@ARGV) < 1 or $ARGV[0] =~ /help/ ) { usage(); } my @nodes = noderange(@ARGV); $noderange = join(',', @nodes); my $nmref = phm('reset', $noderange); my @nanodes = grep { $$nmref{$_} eq 'NA' } @nodes; foreach my $hm (values %{$nmref} ) { if ( $hm eq 'NA' ) { next; } else { my @hmnodes = grep { $$nmref{$_} eq $hm } @nodes; if ( -e "$Bin/../util/rreset.$hm" ) { system("$Bin/../util/rreset.$hm $noderange"); } else { push( @nanodes, @hmnodes ); carp "reset using $hm is not supported"; } } } print "Reset function not supported on: " . join(',', @nanodes) . "\n"; sub usage { print "$0 - Remote Reset\n"; print version; print "Usage: $0 noderange\n"; exit; } =head1 NAME rreset - Remote Reset =head1 SYNOPSIS rreset noderange =head1 DESCRIPTION rreset will attempt to use the method defined in nodehm.tab to perform a reset on the noderange given. =head1 REVISION Revision $Revision: 1.1 $ =head1 AUTHOR Jason Brechin <br...@nc...> =head1 COPYRIGHT This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |