summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-02 22:36:11 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-02 22:36:11 +0100
commitb506ebef3ec30e2cfc225833783ebed59b12524c (patch)
tree19d434a4bbef23dd72010a4a6422abcb567e6d81 /src/core
parentcd00b83f2a241f54193bec625a76136303374a98 (diff)
decoupled network configuration function like it should
Diffstat (limited to 'src/core')
-rw-r--r--src/core/libs/lib-network.sh14
1 files changed, 10 insertions, 4 deletions
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