X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Finstall-bootscripts;h=d6acdd02e1a302dd08ddc3f17e9d962133fb2d2c;hb=bd4976a460cc6af4da09164c6f1d1581480a9771;hp=894c3440a1d1021002e7e345107ae829e0010470;hpb=f920c7ef750f2163b9e407cc453b192ede2c185a;p=hvlinux.git diff --git a/stage2/install-bootscripts b/stage2/install-bootscripts index 894c344..d6acdd0 100755 --- a/stage2/install-bootscripts +++ b/stage2/install-bootscripts @@ -1,9 +1,6 @@ #!/bin/bash -# Reading system configuration informations, functions and package versions. -source ../config/sysinfos -source ../functions -source ../config/packages-list +source ../functions/main DHCP_USED="no" @@ -20,15 +17,21 @@ for nic_device in ${INTERFACES}; do 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" ]; then + 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