|
From: Jason B. <br...@us...> - 2005-01-06 21:53:45
|
Update of /cvsroot/openxcat/openxcat/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24927 Added Files: rcad Log Message: Initial rcad (untested) --- NEW FILE: rcad --- #!/usr/bin/perl # rcad - Remote Ctrl-Alt-Delete # # Written by Jason Brechin <br...@nc...> # Copyright 2004 The Board of Trustees of the University of Illinois. # # $Id: rcad,v 1.1 2005/01/06 21:53:35 brechin Exp $ use FindBin qw($Bin); use lib "$Bin/../lib"; use openXcat::Base; use Carp; use Switch; if ( scalar(@ARGV) < 1 || $ARGV[0] =~ /help/ ) { usage(); } my @nodes = noderange(@ARGV); $noderange = join(',', @nodes); my $nmref = phm('cad', $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/rcad.$hm" ) { system("$Bin/../util/rcad.$hm $noderange"); } else { push( @nanodes, @hmnodes ); carp "cad using $hm is not supported"; } } } print "cad function not supported on: " . join(',', @nanodes) . "\n"; sub usage { print "$0 - Remote Ctrl-Alt-Delete\n"; print version; print "Usage: $0 noderange\n"; exit; } =head1 NAME rcad - Remote Ctrl-Alt-Delete =head1 SYNOPSIS rcad noderange =head1 DESCRIPTION rcad will attempt to use the method defined in nodehm.tab to perform a Ctrl-Alt-Delete action 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 |