remove old scripts
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15156 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
2a55eb6ee5
commit
3f986ecf29
@ -1,68 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
#
|
||||
# Used this script while testing the port of xCAT to AIX - might turn it
|
||||
# into a real command some day.
|
||||
#
|
||||
# Just want to save it for future reference - Norm - 4/22/2008
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
#
|
||||
# This script can be used to completely clean up an AIX xCAT management node
|
||||
# so that it can be used to do a fresh install.
|
||||
#
|
||||
# It will uninstall the xCAT RPMs and OSS prereq RPMs but doesn't remove
|
||||
# the openssh and openssl installp packages.
|
||||
#
|
||||
# It will also remove some additional files/directories that were created by
|
||||
# xCAT.
|
||||
#
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATDIR = $ENV{'XCATDIR'} ? $ENV{'XCATDIR'} : '/etc/xcat';
|
||||
}
|
||||
|
||||
print " Removing xCAT RPMs.\n";
|
||||
`rpm -e xCAT-2.0`;
|
||||
`rpm -e xCAT-server-2.0`;
|
||||
`rpm -e xCAT-client-2.0`;
|
||||
`rpm -e perl-xCAT-2.0`;
|
||||
|
||||
print " Removing /install & /etc/xcat.\n";
|
||||
# rm /install dir
|
||||
`rm -rf /install`;
|
||||
|
||||
# remove /etc/xcat
|
||||
`rm -rf $::XCATDIR`;
|
||||
|
||||
print " Removing SSH keys (/.ssh) and xcatd certificates (/.xcat).\n";
|
||||
`rm -rf /.ssh`;
|
||||
`rm -rf /.xcat`;
|
||||
|
||||
print " Removing OSS prerequisite software.\n";
|
||||
`rpm -e fping-2.2b1-1`;
|
||||
`rpm -e perl-Digest-MD5-2.36-1`;
|
||||
`rpm -e perl-Net_SSLeay.pm-1.30-1`;
|
||||
`rpm -e perl-IO-Socket-SSL-1.06-1`;
|
||||
`rpm -e perl-IO-Stty-.02-1`;
|
||||
`rpm -e perl-IO-Tty-1.07-1`;
|
||||
`rpm -e perl-Expect-1.21-1`;
|
||||
`rpm -e conserver-8.1.16-2`;
|
||||
`rpm -e perl-DBD-SQLite-1.13-1`;
|
||||
`rpm -e perl-DBI-1.55-1`;
|
||||
|
||||
print " Killing the xcatd processes.\n";
|
||||
my @xpids = `ps -ef\|grep \"xcatd\"`;
|
||||
foreach $ps (@xpids)
|
||||
{
|
||||
$ps =~ s/^\s+//; # strip any leading spaces
|
||||
my ($uid, $pid, $ppid, $desc) = split /\s+/, $ps;
|
||||
# if $ps contains "grep" then it's not one of the daemon processes
|
||||
if ( $ps !~/grep/)
|
||||
{
|
||||
# print "pid=$pid\n";
|
||||
`/bin/kill -9 $pid`;
|
||||
}
|
||||
}
|
||||
exit 0;
|
@ -1,151 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
#(C)IBM Corp
|
||||
|
||||
#
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head1 mkrrbc
|
||||
|
||||
Make node definitions for AMMs and Switches (one each per bladecenter)
|
||||
|
||||
mkrrbc -C <cu letter> -L < start Rack number for CU> -R <startrange,endrange> (add)
|
||||
mkrrbc -d -C <cu letter> -R <startrange,endrange> (delete)
|
||||
|
||||
./mkrrbc -C d -L 2 -R 1,60
|
||||
|
||||
will run commands such as:
|
||||
nodeadd bcd60 groups=mm,cud,rack16
|
||||
nodeadd swd60 groups=nortel,switch,cud,rack16
|
||||
|
||||
and build nodelist entries that looks like this:
|
||||
"bcd60","mm,cud,rack16",,,
|
||||
"swd60","nortel,switch,cud,rack16",,,
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Main
|
||||
|
||||
my $rc = 0;
|
||||
|
||||
&parse_args;
|
||||
my $bccmd = "";
|
||||
my $swcmd = "";
|
||||
foreach my $CU (@::CU)
|
||||
{
|
||||
foreach my $range (@::RANGE)
|
||||
{
|
||||
$nodeno = "";
|
||||
if ($range <=9) { # want rr0X
|
||||
$nodeno .="0";
|
||||
}
|
||||
$nodeno .= $range;
|
||||
|
||||
$rack = "rack";
|
||||
$bccmd = "bc";
|
||||
$swcmd = "sw";
|
||||
$bccmd .= $CU;
|
||||
$swcmd.= $CU;
|
||||
$bccmd .= $nodeno;
|
||||
$swcmd.= $nodeno;
|
||||
$bccmd .= " ";
|
||||
$swcmd.= " ";
|
||||
$bccmd .= "groups=mm,cu$CU";
|
||||
$swcmd .= "groups=nortel,switch,cu$CU";
|
||||
|
||||
# calculate the rack number ( 4 AMMs/rack)
|
||||
# 15 racks/CU
|
||||
# Rack number = (AMM# / 4)
|
||||
my $count = ($range-1) / 4;
|
||||
my ($rackno, $rem) = split '\.', $count;
|
||||
|
||||
$rackno = $rackno + $::LOCATION;
|
||||
if ($rackno <=9) { # want rack0X
|
||||
$rack .="0";
|
||||
}
|
||||
$rack .= $rackno;
|
||||
|
||||
$bccmd .= ",";
|
||||
$bccmd .= $rack;
|
||||
$swcmd .= ",";
|
||||
$swcmd .= $rack;
|
||||
|
||||
if ($::DELETE)
|
||||
{
|
||||
if ($::TEST) {
|
||||
print ("noderm $bccmd \n");
|
||||
print ("noderm $swcmd \n");
|
||||
} else {
|
||||
system("noderm $bccmd");
|
||||
system("noderm $swcmd");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($::TEST) {
|
||||
print ("nodeadd $bccmd \n");
|
||||
print ("nodeadd $swcmd \n");
|
||||
} else {
|
||||
system("nodeadd $bccmd");
|
||||
system("nodeadd $swcmd");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
exit $rc;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 parse_args
|
||||
|
||||
Parses for input
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub parse_args
|
||||
{
|
||||
|
||||
Getopt::Long::Configure("posix_default");
|
||||
Getopt::Long::Configure("no_gnu_compat");
|
||||
Getopt::Long::Configure("bundling");
|
||||
my $usagemsg =
|
||||
" mkrrbc -h \n mkrrbc [-d] -C [a|b|,...,r] -L [start rack number for CU] -R [startrange,endrange] [-t|--test]\n";
|
||||
if (
|
||||
!GetOptions(
|
||||
'C|CU=s' => \$::CU,
|
||||
'L|LOC=s' => \$::LOCATION,
|
||||
'h|help' => \$::HELP,
|
||||
'd|delete' => \$::DELETE,
|
||||
'R|RANGE=s' => \$::RANGE,
|
||||
't|test' => \$::TEST
|
||||
|
||||
)
|
||||
)
|
||||
{
|
||||
printf $usagemsg;
|
||||
exit 1;
|
||||
}
|
||||
if ($::HELP)
|
||||
{
|
||||
printf $usagemsg;
|
||||
exit 0;
|
||||
}
|
||||
@::CU = split(',', $::CU);
|
||||
|
||||
my ($fNum, $eNum) = split(',', $::RANGE);
|
||||
my $prefix;
|
||||
foreach my $suffix ($fNum .. $eNum)
|
||||
{
|
||||
my $numOfZeros = (length($fNum) - length($suffix));
|
||||
my $prefix = '0' x $numOfZeros;
|
||||
push @::RANGE, "$fRoot$prefix$suffix$fDomain";
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user