summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-01 19:10:02 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-01 19:10:02 +0100
commitad4447e651202c1e3ba0b665e40269fe345e9bc0 (patch)
treeb14c685dcb9a6383e9adf162ef6e38f3323df65c /src
parent108a1482a83505bb1530fdebb3dfedebeaa6ad35 (diff)
cleanup + bugfixes
Diffstat (limited to 'src')
-rw-r--r--src/lib/lib-network.sh49
1 files changed, 22 insertions, 27 deletions
diff --git a/src/lib/lib-network.sh b/src/lib/lib-network.sh
index 5e6652d..249b37c 100644
--- a/src/lib/lib-network.sh
+++ b/src/lib/lib-network.sh
@@ -6,33 +6,28 @@
#
auto_network()
{
- # exit if network wasn't configured in installer
- if [ $S_NET -eq 0 ]; then
- return 1
- fi
+ if [ $S_DHCP -ne 1 ]; then
+ sed -i "s#eth0=\"eth0#$INTERFACE=\"$INTERFACE#g" ${TARGET_DIR}/etc/rc.conf
+ sed -i "s# 192.168.0.2 # $IPADDR #g" ${TARGET_DIR}/etc/rc.conf
+ sed -i "s# 255.255.255.0 # $SUBNET #g" ${TARGET_DIR}/etc/rc.conf
+ sed -i "s# 192.168.0.255\"# $BROADCAST\"#g" ${TARGET_DIR}/etc/rc.conf
+ sed -i "s#eth0)#$INTERFACE)#g" ${TARGET_DIR}/etc/rc.conf
+ if [ "$GW" != "" ]; then
+ sed -i "s#gw 192.168.0.1#gw $GW#g" ${TARGET_DIR}/etc/rc.conf
+ sed -i "s#!gateway#gateway#g" ${TARGET_DIR}/etc/rc.conf
+ fi
+ echo "nameserver $DNS" >> ${TARGET_DIR}/etc/resolv.conf
+ else
+ sed -i "s#eth0=\"eth0.*#$INTERFACE=\"dhcp\"#g" ${TARGET_DIR}/etc/rc.conf
+ fi
- ask_yesno "Do you want to use the network settings from the installer in rc.conf and resolv.conf?\n\nIf you used Proxy settings, they will be written to /etc/profile.d/proxy.sh" || return 1
+ if [ "$PROXY_HTTP" != "" ]; then
+ echo "export http_proxy=$PROXY_HTTP" >> ${TARGET_DIR}/etc/profile.d/proxy.sh;
+ chmod a+x ${TARGET_DIR}/etc/profile.d/proxy.sh
+ fi
- if [ $S_DHCP -ne 1 ]; then
- sed -i "s#eth0=\"eth0#$INTERFACE=\"$INTERFACE#g" ${TARGET_DIR}/etc/rc.conf
- sed -i "s# 192.168.0.2 # $IPADDR #g" ${TARGET_DIR}/etc/rc.conf
- sed -i "s# 255.255.255.0 # $SUBNET #g" ${TARGET_DIR}/etc/rc.conf
- sed -i "s# 192.168.0.255\"# $BROADCAST\"#g" ${TARGET_DIR}/etc/rc.conf
- sed -i "s#eth0)#$INTERFACE)#g" ${TARGET_DIR}/etc/rc.conf
- if [ "$GW" != "" ]; then
- sed -i "s#gw 192.168.0.1#gw $GW#g" ${TARGET_DIR}/etc/rc.conf
- sed -i "s#!gateway#gateway#g" ${TARGET_DIR}/etc/rc.conf
- fi
- echo "nameserver $DNS" >> ${TARGET_DIR}/etc/resolv.conf
- else
- sed -i "s#eth0=\"eth0.*#$INTERFACE=\"dhcp\"#g" ${TARGET_DIR}/etc/rc.conf
- fi
- if [ "$PROXY_HTTP" != "" ]; then
- notify "export http_proxy=$PROXY_HTTP" >> ${TARGET_DIR}/etc/profile.d/proxy.sh;
- chmod a+x ${TARGET_DIR}/etc/profile.d/proxy.sh
- fi
- if [ "$PROXY_FTP" != "" ]; then
- notify "export ftp_proxy=$PROXY_FTP" >> ${TARGET_DIR}/etc/profile.d/proxy.sh;
- chmod a+x ${TARGET_DIR}/etc/profile.d/proxy.sh
- fi
+ if [ "$PROXY_FTP" != "" ]; then
+ echo "export ftp_proxy=$PROXY_FTP" >> ${TARGET_DIR}/etc/profile.d/proxy.sh;
+ chmod a+x ${TARGET_DIR}/etc/profile.d/proxy.sh
+ fi
}