diff options
author | Chris Gianelloni <wolf31o2@gentoo.org> | 2004-10-20 11:37:33 +0000 |
---|---|---|
committer | Chris Gianelloni <wolf31o2@gentoo.org> | 2004-10-20 11:37:33 +0000 |
commit | b82d7f8a8e58938f4d0c79639c68dcda3d4808f2 (patch) | |
tree | c9ccd278ddf2c43130187af8dc875667e7b3fdd1 /net-setup | |
parent | Updated for 1.0.6 and 2004.3. (diff) | |
download | livecd-tools-b82d7f8a8e58938f4d0c79639c68dcda3d4808f2.tar.gz livecd-tools-b82d7f8a8e58938f4d0c79639c68dcda3d4808f2.tar.bz2 livecd-tools-b82d7f8a8e58938f4d0c79639c68dcda3d4808f2.zip |
New net-setup shoudl fix bug #68246.
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/livecd-tools/trunk@11 7bf51bff-881f-0410-a643-fba68b97345e
Diffstat (limited to 'net-setup')
-rwxr-xr-x | net-setup | 47 |
1 files changed, 32 insertions, 15 deletions
@@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/livecd-tools/net-setup,v 1.4 2004/09/10 01:47:19 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/livecd-tools/net-setup,v 1.5 2004/10/20 11:37:33 wolf31o2 Exp $ #!/bin/bash @@ -17,30 +17,41 @@ fi [ ! -d /tmp/setup.opts ] && mkdir /tmp/setup.opts cd /tmp/setup.opts -WIRED_WIRELESS=`dialog --title "Network setup" --menu "This script is designed to setup both wired and wireless network settings. All questions below apply to the ${1} interface only. Choose one option:" 20 60 7 1 "My network is wireless" 2 "My network is wired"` +dialog --title "Network setup" --menu "This script is designed to setup both wired and wireless network settings. All questions below apply to the ${1} interface only. Choose one option:" 20 60 7 1 "My network is wireless" 2 "My network is wired" 2> ${1}.WIRED +WIRED_WIRELESS=`cat ${1}.WIRED` case $WIRED_WIRELESS in 1) - SSID=`dialog --title "SSID" --inputbox "Please enter your SSID, or leave blank for selecting the nearest open network" 20 50` + dialog --title "SSID" --inputbox "Please enter your SSID, or leave blank for selecting the nearest open network" 20 50 2> ${1}.SSID + SSID=`cat ${1}.SSID` if [ -n "${SSID}" ]; then - WEP_ENABLED=`dialog --title "WEP (Part 1)" --menu "Does your network use encryption?" 20 60 7 1 "Yes" 2 "No"` - case $WEP_ENABLED in + dialog --title "WEP (Part 1)" --menu "Does your network use encryption?" 20 60 7 1 "Yes" 2 "No" 2> ${1}.WEP + WEP=`cat ${1}.WEP` + case $WEP in 1) - WEP_TYPE=`dialog --title "WEP (Part 2)" --menu "Are you entering your WEP key in HEX or ASCII?" 20 60 7 1 "HEX" 2 "ASCII"` + dialog --title "WEP (Part 2)" --menu "Are you entering your WEP key in HEX or ASCII?" 20 60 7 1 "HEX" 2 "ASCII" 2> ${1}.WEPTYPE + WEP_TYPE=`cat ${1}.WEPTYPE` case $WEP_TYPE in 1) - WEP_KEY=`dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in the form of XXXX-XXXX-XX for 64-bit or XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX for 128-bit" 20 50` + dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in the form of XXXX-XXXX-XX for 64-bit or XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX for 128-bit" 20 50 2> ${1}.WEPKEY + WEP_KEY=`cat ${1}.WEPKEY` if [ -n "${WEP_KEY}" -a -x /usr/sbin/iwconfig ]; then - /usr/sbin/iwconfig ${1} essid \""${SSID}"\" + /usr/sbin/iwconfig ${1} essid \"${SSID}\" /usr/sbin/iwconfig ${1} key "${WEP_KEY}" + fi ;; 2) - WEP_KEY=`dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in ASCII form. This should be 5 or 13 characters for either 64-bit or 128-bit encryption, repectively" 20 50` + dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in ASCII form. This should be 5 or 13 characters for either 64-bit or 128-bit encryption, repectively" 20 50 2> ${1}.WEPKEY + WEP_KEY=`cat ${1}.WEPKEY` if [ -n "${WEP_KEY}" -a -x /usr/sbin/iwconfig ]; then /usr/sbin/iwconfig ${1} essid \""${SSID}"\" /usr/sbin/iwconfig ${1} key s:"${WEP_KEY}" + fi ;; esac + ;; 2) + /usr/sbin/iwconfig ${1} essid \""${SSID}"\" + /usr/sbin/iwconfig ${1} key off ;; esac fi @@ -49,18 +60,24 @@ case $WIRED_WIRELESS in ;; esac -DHCP=`dialog --title "TCP/IP setup" --menu "You can use DHCP to automatically configure a network interface or you can specify an IP and related settings manually. Choose one option:" 20 60 7 1 "Use DHCP to auto-detect my network settings" 2 "Specify an IP address manually"` +dialog --title "TCP/IP setup" --menu "You can use DHCP to automatically configure a network interface or you can specify an IP and related settings manually. Choose one option:" 20 60 7 1 "Use DHCP to auto-detect my network settings" 2 "Specify an IP address manually" 2> ${1}.DHCP +DHCP=`cat ${1}.DHCP` case $DHCP in 1) /sbin/dhcpcd -t 10 ${1} & ;; 2) - IP=`dialog --title "IP address" --inputbox "Please enter an IP address for ${1}:" 20 50 "192.168.1.1"` + dialog --title "IP address" --inputbox "Please enter an IP address for ${1}:" 20 50 "192.168.1.1" 2> ${1}.IP + IP=`cat ${1}.IP` BC_TEMP="`echo $IP|cut -d . -f 1`.`echo $IP|cut -d . -f 2`.`echo $IP|cut -d . -f 3`.255" - BROADCAST=`dialog --title "Broadcast address" --inputbox "Please enter a Broadcast address for ${1}:" 20 50 "${BC_TEMP}"` - NETMASK=`dialog --title "Network mask" --inputbox "Please enter a Network Mask for ${1}:" 20 50 "255.255.255.0"` - GATEWAY=`dialog --title "Gateway" --inputbox "Please enter a Gateway for ${1} (hit enter for none:)" 20 50` - DNS=`dialog --title "DNS server" --inputbox "Please enter a name server to use (hit enter for none:)" 20 50` + dialog --title "Broadcast address" --inputbox "Please enter a Broadcast address for ${1}:" 20 50 "${BC_TEMP}" 2> ${1}.BC + BROADCAST=`cat ${1}.BC` + dialog --title "Network mask" --inputbox "Please enter a Network Mask for ${1}:" 20 50 "255.255.255.0" 2> ${1}.NM + NETMASK=`cat ${1}.NM` + dialog --title "Gateway" --inputbox "Please enter a Gateway for ${1} (hit enter for none:)" 20 50 2> ${1}.GW + GATEWAY=`cat ${1}.GW` + dialog --title "DNS server" --inputbox "Please enter a name server to use (hit enter for none:)" 20 50 2> ${1}.DNS + DNS=`cat ${1}.DNS` /sbin/ifconfig ${1} ${IP} broadcast ${BROADCAST} netmask ${NETMASK} if [ -n "${GATEWAY}" ]; then /sbin/route add default gw ${GATEWAY} dev $1 netmask 0.0.0.0 metric 1 |