bug 3763:write install nics's configuration file
This commit is contained in:
parent
22cbc9f005
commit
ce0d0e18f7
@ -408,6 +408,11 @@ elif [ "$1" = "-s" ];then
|
||||
str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'`
|
||||
fi
|
||||
fi
|
||||
if [ -n "$MACADDRESS" ];then
|
||||
str_inst_mac=$MACADDRESS
|
||||
else
|
||||
str_inst_mac=`ifconfig $str_inst_nic | grep HWaddr | awk -F'HWaddr' '{print $2}' | sed 's/\s*//'`
|
||||
fi
|
||||
|
||||
if [ -z "$str_inst_ip" -o -z "$str_inst_mask" ];then
|
||||
logger -t xcat -p local4.err "configeth: config install nic, can not find the information from lease file, return."
|
||||
@ -421,6 +426,7 @@ elif [ "$1" = "-s" ];then
|
||||
echo "iface ${str_inst_nic} inet static" >> $str_conf_file
|
||||
echo " address ${str_inst_ip}" >> $str_conf_file
|
||||
echo " netmask ${str_inst_mask}" >> $str_conf_file
|
||||
echo " hwaddress ether ${str_inst_mac}" >> $str_conf_file
|
||||
if [ -n "$str_inst_gateway" ];then
|
||||
echo " gateway $str_inst_gateway" >> $str_conf_file
|
||||
fi
|
||||
@ -432,6 +438,7 @@ elif [ "$1" = "-s" ];then
|
||||
echo "BOOTPROTO=static" >> $str_conf_file
|
||||
echo "IPADDR=${str_inst_ip}" >> $str_conf_file
|
||||
echo "NETMASK=${str_inst_mask}" >> $str_conf_file
|
||||
echo "HWADDR=${str_inst_mac}" >> $str_conf_file
|
||||
echo "STARTMODE=onboot" >> $str_conf_file
|
||||
if [ -n "$str_inst_gateway" ];then
|
||||
grep -i "default" /etc/sysconfig/network/routes
|
||||
@ -451,6 +458,7 @@ elif [ "$1" = "-s" ];then
|
||||
echo "NETMASK=${str_inst_mask}" >> $str_conf_file
|
||||
echo "BOOTPROTO=static" >> $str_conf_file
|
||||
echo "ONBOOT=yes" >> $str_conf_file
|
||||
echo "HWADDR=${str_inst_mac}" >> $str_conf_file
|
||||
if [ -n "$str_inst_gateway" ];then
|
||||
grep -i "GATEWAY" /etc/sysconfig/network
|
||||
if [ $? -eq 0 ];then
|
||||
|
Loading…
Reference in New Issue
Block a user