file="/etc/sysconfig/network/ifconfig.${nic_device}"
echo "ONBOOT=\"yes\"" > ${file}
echo "BOOTPROTO=\"${BOOTPROTO[${LOOP_INDEX}]}\"" >> ${file}
- echo "IPADDR=\"${IP_ADDRESS[${LOOP_INDEX}]}\"" >> ${file}
- echo "PREFIX_LENGTH=\"${PREFIX_LENGTH[${LOOP_INDEX}]}\"" >> ${file}
- echo "IFSCOPE=\"\"" >> ${file}
- echo "GATEWAY=\"${GATEWAY[${LOOP_INDEX}]}\"" >> ${file}
-
if [ "x${BOOTPROTO[${LOOP_INDEX}]}" = "xdhcp" -o \
"x${BOOTPROTO[${LOOP_INDEX}]}" = "xwifi" ]; then
DHCP_USED="yes"
fi
+ if [ -n "${IP_ADDRESS[${LOOP_INDEX}]}" ]; then
+ echo "IPADDR=\"${IP_ADDRESS[${LOOP_INDEX}]}\"" >> ${file}
+ fi
+ if [ -n "${PREFIX_LENGTH[${LOOP_INDEX}]}" ]; then
+ echo "PREFIX_LENGTH=\"${PREFIX_LENGTH[${LOOP_INDEX}]}\"" >> ${file}
+ fi
+ if [ -n "${GATEWAY[${LOOP_INDEX}]}" ]; then
+ echo "GATEWAY=\"${GATEWAY[${LOOP_INDEX}]}\"" >> ${file}
+ fi
+
LOOP_INDEX=$((${LOOP_INDEX} + 1))
done