Skip to content

Commit

Permalink
Fix tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Obihoernchen authored Jun 24, 2024
1 parent 70e3eba commit d333ef5
Showing 1 changed file with 92 additions and 92 deletions.
184 changes: 92 additions & 92 deletions xCAT/postscripts/configib
Original file line number Diff line number Diff line change
Expand Up @@ -433,25 +433,25 @@ IPADDR=$nicip" > $dir/ifcfg-$nic
fi

#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $dir/ifcfg-$nic
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic
else
echo "${name}=${value}" >> $dir/ifcfg-$nic
fi
fi
i=$((i+1))
done
else # not the first ip address
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $dir/ifcfg-$nic
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic
else
echo "${name}=${value}" >> $dir/ifcfg-$nic
fi
fi
i=$((i+1))
done
else # not the first ip address
echo "LABEL_$ipindex=$ipindex
IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic
# ipv6
Expand All @@ -469,24 +469,24 @@ IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic
fi
fi
#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $dir/ifcfg-$nic
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic
else
echo "${name}=${value}" >> $dir/ifcfg-$nic
fi
fi
i=$((i+1))
done
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $dir/ifcfg-$nic
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic
else
echo "${name}=${value}" >> $dir/ifcfg-$nic
fi
fi
i=$((i+1))
done
fi # end if [ $ipindex -eq 1 ]
elif [ $OS_name == 'redhat' ]
then
Expand Down Expand Up @@ -529,25 +529,25 @@ IPADDR=$nicip" > $dir/ifcfg-$nic
fi


#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $dir/ifcfg-$nic
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic
else
echo "${name}=${value}" >> $dir/ifcfg-$nic
fi
fi
i=$((i+1))
done
#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $dir/ifcfg-$nic
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic
else
echo "${name}=${value}" >> $dir/ifcfg-$nic
fi
fi
i=$((i+1))
done
else # not the first ip address
# ipv6
if echo $nicip | grep : 2>&1 1>/dev/null
Expand Down Expand Up @@ -598,25 +598,25 @@ IPADDR$ipindex=$nicip"
fi
fi

#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $cfgfile
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $cfgfile
else
echo "${name}=${value}" >> $cfgfile
fi
fi
i=$((i+1))
done
#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ (rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
else
grep -i "${name}" $cfgfile
if [ $? -eq 0 ]; then
sed -i "s/.*${name}.*/${name}=${value}/i" >> $cfgfile
else
echo "${name}=${value}" >> $cfgfile
fi
fi
i=$((i+1))
done

# need to run ifup eth1:1 for RedHat
if [ $nmcli_used -eq 0 ]; then
Expand Down Expand Up @@ -673,24 +673,24 @@ netmask $netmask" >> /etc/network/interfaces
# echo "gateway $gateway" >> /etc/network/interfaces
#fi
fi
fi
#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
grep -i "${name}" /etc/network/interfaces
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name} ${value}/i" >> /etc/network/interfaces
else
echo "${name} ${value}" >> /etc/network/interfaces
fi
i=$((i+1))
done
fi
#add extra params
i=0
while [ $i -lt ${#array_extra_param_names[@]} ]
do
name="${array_extra_param_names[$i]}"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
grep -i "${name}" /etc/network/interfaces
if [ $? -eq 0 ];then
sed -i "s/.*${name}.*/${name} ${value}/i" >> /etc/network/interfaces
else
echo "${name} ${value}" >> /etc/network/interfaces
fi
i=$((i+1))
done

else
else
echo "Unsupported operating system"
logger -p local4.err -t $log_label "Unsupported operating system"
fi
Expand Down

0 comments on commit d333ef5

Please sign in to comment.