From b506ebef3ec30e2cfc225833783ebed59b12524c Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 2 Nov 2008 22:36:11 +0100 Subject: decoupled network configuration function like it should --- src/core/libs/lib-network.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/core/libs/lib-network.sh') diff --git a/src/core/libs/lib-network.sh b/src/core/libs/lib-network.sh index 93ba9cb..ab91069 100644 --- a/src/core/libs/lib-network.sh +++ b/src/core/libs/lib-network.sh @@ -1,12 +1,18 @@ #!/bin/bash -# auto_network(). taken from setup +# auto_network(). taken from setup. edited # configures network on host system according to installer # settings if user wishes to do so -# -auto_network() +# $1 dhcp/fixed +# $2 http proxy (optional. defaults to '') +# $3 ftp proxy (optional. defaults to '') +# TODO: autonetwork must be a wrapper that checks $PROXY_HTTP, $PROXY_FTP and $S_DHCP and calls this function +target_configure_network() { - if [ $S_DHCP -ne 1 ]; then + [ "$1" != dhcp -a "$1" != fixed ] && die_error "target_configure_network \$1 must be 'dhcp' or 'fixed'" + PROXY_HTTP="$2" + PROXY_FTP="$3" + if [ "$1" = fixed ]; then sed -i "s#eth0=\"eth0#$INTERFACE=\"$INTERFACE#g" ${var_TARGET_DIR}/etc/rc.conf sed -i "s# 192.168.0.2 # $IPADDR #g" ${var_TARGET_DIR}/etc/rc.conf sed -i "s# 255.255.255.0 # $SUBNET #g" ${var_TARGET_DIR}/etc/rc.conf -- cgit v1.2.3-54-g00ecf