/[livecd-tools]/trunk/net-setup
Gentoo

Contents of /trunk/net-setup

Parent Directory Parent Directory | Revision Log Revision Log


Revision 133 - (hide annotations) (download)
Tue Oct 30 20:59:55 2007 UTC (6 years, 10 months ago) by wolf31o2
File size: 1269 byte(s)
Added a small fix for bug #111972 and also doing some minor clean up.
1 wolf31o2 51 #!/bin/bash
2 zhen 3
3 wolf31o2 51 if [ -f /sbin/livecd-functions.sh ]
4     then
5     source /sbin/livecd-functions.sh
6     else
7     echo "ERROR: /sbin/livecd-functions.sh could not be loaded!"
8 zhen 2 exit 1
9     fi
10    
11 wolf31o2 103 if [ ! -x $(which dialog) ]
12     then
13     echo "ERROR: The dialog utility is required for net-setup. Exiting!"
14     exit 1
15     fi
16    
17 wolf31o2 51 livecd_check_root || exit 1
18    
19 wolf31o2 104 # Hide any potential error messages from the readlink/dirname/etc calls below
20     exec 2>/dev/null
21    
22 wolf31o2 51 if [ -z "${1}" ]
23     then
24 wolf31o2 104 show_ifmenu
25     echo $iface
26 wolf31o2 51 else
27     iface="${1}"
28 zhen 2 fi
29    
30 wolf31o2 132 [ ! -d /tmp/setup.opts ] && mkdir -p /tmp/setup.opts
31 zhen 2 cd /tmp/setup.opts
32    
33 wolf31o2 104 while true; do
34     show_ifconfirm $iface
35     [[ $result == "yes" ]] && break
36     show_ifmenu
37     done
38    
39     # Show stderr again
40     exec 2>/dev/stderr
41    
42 wolf31o2 45 dialog --title "Network setup" --menu "This script is designed to setup both wired and wireless network settings. All questions below apply to the ${iface} interface only. Choose one option:" 20 60 7 1 "My network is wireless" 2 "My network is wired" 2> ${iface}.WIRED_WIRELESS
43 wolf31o2 133 WIRED_WIRELESS=$(tail -n 1 ${iface}.WIRED_WIRELESS)
44 wolf31o2 18 case ${WIRED_WIRELESS} in
45 wolf31o2 6 1)
46 wolf31o2 51 livecd_config_wireless
47     livecd_config_ip
48 wolf31o2 55 livecd_write_wireless_conf
49 wolf31o2 6 ;;
50     2)
51 wolf31o2 51 livecd_config_ip
52 wolf31o2 9 ;;
53     esac
54 wolf31o2 55 livecd_write_net_conf
55 wolf31o2 9
56 zhen 2 echo "Type \"ifconfig\" to make sure the interface was configured correctly."
57 zhen 3
58 wolf31o2 6 # vim: ts=4

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20