summaryrefslogtreecommitdiff
path: root/src/core/libs
diff options
context:
space:
mode:
authorMatthias Dienstbier <mdienstbier@googlemail.com>2010-03-11 21:01:44 +0100
committerMatthias Dienstbier <mdienstbier@googlemail.com>2010-03-11 21:01:44 +0100
commit9525c62d5f6fc9e23f7571b26d6b1deaec685789 (patch)
tree1b14cfff45909682185052402c73460fd152f6d1 /src/core/libs
parent468d5f7ffb1abdfd6ad82b5223ed0cd70e77f37f (diff)
fix target_configure_network for dhcp default in rc.conf
Diffstat (limited to 'src/core/libs')
-rw-r--r--src/core/libs/lib-network.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/libs/lib-network.sh b/src/core/libs/lib-network.sh
index b7f6c08..19d4862 100644
--- a/src/core/libs/lib-network.sh
+++ b/src/core/libs/lib-network.sh
@@ -12,6 +12,8 @@ target_configure_network()
PROXY_HTTP="$2"
PROXY_FTP="$3"
if [ "$1" = fixed ]; then
+ sed -i "s/#eth0=\"eth0/eth0=\"eth0/g" ${var_TARGET_DIR}/etc/rc.conf || return 1
+ sed -i "s/^eth0=\"dhcp/#eth0=\"dhcp/g" ${var_TARGET_DIR}/etc/rc.conf || return 1
sed -i "s#eth0=\"eth0#${INTERFACE:-eth0}=\"${INTERFACE:-eth0}#g" ${var_TARGET_DIR}/etc/rc.conf || return 1
sed -i "s#${INTERFACE:-eth0} 192.168.0.2#${INTERFACE:-eth0} ${IPADDR:-192.168.0.2}#g" ${var_TARGET_DIR}/etc/rc.conf || return 1
sed -i "s#netmask 255.255.255.0#netmask ${SUBNET:-255.255.255.0}#g" ${var_TARGET_DIR}/etc/rc.conf || return 1
@@ -25,7 +27,9 @@ target_configure_network()
echo "nameserver $DNS" >> ${var_TARGET_DIR}/etc/resolv.conf || return 1
fi
else
- sed -i "s#eth0=\"eth0.*#${INTERFACE:-eth0}=\"dhcp\"#g" ${var_TARGET_DIR}/etc/rc.conf || return 1
+ sed -i "s/^eth0=\"eth0/#eth0=\"eth0/g" ${var_TARGET_DIR}/etc/rc.conf || return 1
+ sed -i "s/#eth0=\"dhcp/eth0=\"dhcp/g" ${var_TARGET_DIR}/etc/rc.conf || return 1
+ sed -i "s#eth0=\"dhcp#${INTERFACE:-eth0}=\"dhcp#g" ${var_TARGET_DIR}/etc/rc.conf || return 1
fi
sed -i "s#INTERFACES=(eth0)#INTERFACES=(${INTERFACE:-eth0})#g" ${var_TARGET_DIR}/etc/rc.conf || return 1