USERDATATMP="/tmp/data_tmp"

function fn_get_value(){
    cat ${USERDATATMP} | grep -i "^$1=" | awk -F"=" '{print $2}' | sed 's/ //g'
}

function fn_modify_ifcfg(){
    nic_count=`fn_get_value NIC_COUNT`
    eth_name="/etc/sysconfig/network/ifcfg-"
    for (( i=$nic_count-1;i>=0;i--)); do
        nic_device=`fn_get_value NIC_DEVICE_$i`
        rm -rf $eth_name$nic_device
        touch $eth_name$nic_device
        echo "TYPE=Ethernet">> $eth_name$nic_device
        echo "PROXY_METHOD=none">> $eth_name$nic_device
        echo "BROWSER_ONLY=no">> $eth_name$nic_device
        echo "BOOTPROTO=static">> $eth_name$nic_device
        echo "DEFROUTE=yes">> $eth_name$nic_device
        echo "IPV4_FAILURE_FATAL=no">> $eth_name$nic_device
        echo "IPV6INIT=yes">> $eth_name$nic_device
        echo "IPV6_AUTOCONF=yes">> $eth_name$nic_device
        echo "IPV6_DEFROUTE=yes">> $eth_name$nic_device
        echo "IPV6_FAILURE_FATAL=no">> $eth_name$nic_device
        echo "IPV6_ADDR_GEN_MODE=stable-privacy">> $eth_name$nic_device
        echo "ONBOOT=yes">> $eth_name$nic_device
        echo "NAME=' Huawei Technologies Co., Ltd. Device d110'">> $eth_name$nic_device
        echo "DEVICE=$nic_device">> $eth_name$nic_device
        echo "BROADCAST=''">> $eth_name$nic_device
        echo "ETHTOOL_OPTIONS=''">> $eth_name$nic_device
        echo "MTU=''">> $eth_name$nic_device
        echo "NETWORK=''">> $eth_name$nic_device
        echo "REMOTE_IPADDR=''">> $eth_name$nic_device
        echo "STARTMODE='auto'">> $eth_name$nic_device


    done
    return 0
}

fn_modify_ifcfg