summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-network.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-02 22:04:36 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-02 22:04:36 +0100
commit4019db7a540d6dfcef6431cfc11ca748595e2ca1 (patch)
treefc47df27708360c71699609f80d0b732b28412d8 /src/core/libs/lib-network.sh
parentc8a41a8f2afdb46e9da3bc9a677210b74b82eaab (diff)
file hierarchy overhaul. now a structure that makes more sense: user and core separated. we now differentiate between procedures and libraries - no more "profiles" - + some bug fixed + probably quite a few introduced + runtime directory + separated my own stuff more
Diffstat (limited to 'src/core/libs/lib-network.sh')
-rw-r--r--src/core/libs/lib-network.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/libs/lib-network.sh b/src/core/libs/lib-network.sh
new file mode 100644
index 0000000..93ba9cb
--- /dev/null
+++ b/src/core/libs/lib-network.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# auto_network(). taken from setup
+# configures network on host system according to installer
+# settings if user wishes to do so
+#
+auto_network()
+{
+ if [ $S_DHCP -ne 1 ]; 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
+ sed -i "s# 192.168.0.255\"# $BROADCAST\"#g" ${var_TARGET_DIR}/etc/rc.conf
+ sed -i "s#eth0)#$INTERFACE)#g" ${var_TARGET_DIR}/etc/rc.conf
+ if [ "$GW" != "" ]; then
+ sed -i "s#gw 192.168.0.1#gw $GW#g" ${var_TARGET_DIR}/etc/rc.conf
+ sed -i "s#!gateway#gateway#g" ${var_TARGET_DIR}/etc/rc.conf
+ fi
+ echo "nameserver $DNS" >> ${var_TARGET_DIR}/etc/resolv.conf
+ else
+ sed -i "s#eth0=\"eth0.*#$INTERFACE=\"dhcp\"#g" ${var_TARGET_DIR}/etc/rc.conf
+ fi
+
+ if [ "$PROXY_HTTP" != "" ]; then
+ echo "export http_proxy=$PROXY_HTTP" >> ${var_TARGET_DIR}/etc/profile.d/proxy.sh;
+ chmod a+x ${var_TARGET_DIR}/etc/profile.d/proxy.sh
+ fi
+
+ if [ "$PROXY_FTP" != "" ]; then
+ echo "export ftp_proxy=$PROXY_FTP" >> ${var_TARGET_DIR}/etc/profile.d/proxy.sh;
+ chmod a+x ${var_TARGET_DIR}/etc/profile.d/proxy.sh
+ fi
+}