Fixed case-sensitive sed and egrep.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11326 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2012-01-03 20:55:48 +00:00
parent 9d68902931
commit 5040aa6a71
2 changed files with 9 additions and 9 deletions

View File

@ -482,7 +482,7 @@ sub getIfcfgByNic {
# If it is SLES 10 - ifcfg-qeth file is in /etc/sysconfig/network
elsif ( $os =~ m/SUSE Linux Enterprise Server 10/i ) {
$out = `ssh -o ConnectTimeout=5 $node "ls /etc/sysconfig/network/ifcfg-qeth*" | grep "$nic"`;
$out = `ssh -o ConnectTimeout=5 $node "ls /etc/sysconfig/network/ifcfg-qeth*" | grep -i "$nic"`;
@parms = split( '\n', $out );
return ( $parms[0] );
}
@ -498,7 +498,7 @@ sub getIfcfgByNic {
foreach (@file) {
# If the network file contains the NIC address
$out = `ssh -o ConnectTimeout=5 $node "cat $_" | grep "$nic"`;
$out = `ssh -o ConnectTimeout=5 $node "cat $_" | grep -i "$nic"`;
if ($out) {
# Return ifcfg-eth file path

View File

@ -1819,7 +1819,7 @@ sub makeVM {
my $nicDef = xCAT::zvmUtils->replaceStr( $oldNicDef, $netName, "$netName MACID $macId" );
# Append MACID at the end
$out = `sed --in-place -e "s,$oldNicDef,$nicDef,g" $userEntry`;
$out = `sed --in-place -e "s,$oldNicDef,$nicDef,i" $userEntry`;
}
# SCP file over to HCP
@ -2418,7 +2418,7 @@ sub clone {
$out = `cp $srcUserEntry $userEntry`;
# Replace source userID with target userID
$out = `sed --in-place -e "s,$sourceId,$tgtUserId,g" $userEntry`;
$out = `sed --in-place -e "s,$sourceId,$tgtUserId,i" $userEntry`;
# Get target MAC address in 'mac' table
my $targetMac;
@ -2460,7 +2460,7 @@ sub clone {
$oldMacId = xCAT::zvmUtils->trimStr($oldMacId);
# Replace old MACID
$out = `sed --in-place -e "s,$oldMacId,$macId,g" $userEntry`;
$out = `sed --in-place -e "s,$oldMacId,$macId,i" $userEntry`;
}
else {
@ -2470,7 +2470,7 @@ sub clone {
my $nicDef = xCAT::zvmUtils->replaceStr( $oldNicDef, $hcpNetName, "$hcpNetName MACID $macId" );
# Append MACID at the end
$out = `sed --in-place -e "s,$oldNicDef,$nicDef,g" $userEntry`;
$out = `sed --in-place -e "s,$oldNicDef,$nicDef,i" $userEntry`;
}
}
@ -2907,8 +2907,8 @@ EOM"`;
# Location of this file depends on the OS
my $ifcfgPath = $cloneMntPt;
$ifcfgPath .= $srcIfcfg;
$out = `ssh $hcp sed --in-place -e "s/$sourceNode/$tgtNode/g" \ -e "s/$sourceIp/$targetIp/g" $cloneMntPt/etc/hosts`;
$out = `ssh $hcp sed --in-place -e "s/$sourceIp/$targetIp/g" \ -e "s/$sourceNode/$tgtNode/g" $ifcfgPath`;
$out = `ssh $hcp sed --in-place -e "s/$sourceNode/$tgtNode/g" \ -e "s/$sourceIp/$targetIp/i" $cloneMntPt/etc/hosts`;
$out = `ssh $hcp sed --in-place -e "s/$sourceIp/$targetIp/i" \ -e "s/$sourceNode/$tgtNode/g" $ifcfgPath`;
# Set MAC address
my $networkFile = $tgtNode . "NetworkConfig";
@ -2962,7 +2962,7 @@ EOM"`;
}
# Set MAC address
$out = `ssh $hcp sed --in-place -e "s/$srcMac/$targetMac/g" $ifcfgPath`;
$out = `ssh $hcp sed --in-place -e "s/$srcMac/$targetMac/i" $ifcfgPath`;
}
#*** SUSE ***