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

Contents of /trunk/net-setup

Parent Directory Parent Directory | Revision Log Revision Log


Revision 132 - (show annotations) (download)
Sat Oct 13 16:58:51 2007 UTC (6 years, 9 months ago) by wolf31o2
File size: 1263 byte(s)
Cleaning up the coding style on some parts and doing some minor cleanups.
1 #!/bin/bash
2
3 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 exit 1
9 fi
10
11 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 livecd_check_root || exit 1
18
19 # Hide any potential error messages from the readlink/dirname/etc calls below
20 exec 2>/dev/null
21
22 if [ -z "${1}" ]
23 then
24 show_ifmenu
25 echo $iface
26 else
27 iface="${1}"
28 fi
29
30 [ ! -d /tmp/setup.opts ] && mkdir -p /tmp/setup.opts
31 cd /tmp/setup.opts
32
33 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 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 WIRED_WIRELESS=$(cat ${iface}.WIRED_WIRELESS)
44 case ${WIRED_WIRELESS} in
45 1)
46 livecd_config_wireless
47 livecd_config_ip
48 livecd_write_wireless_conf
49 ;;
50 2)
51 livecd_config_ip
52 ;;
53 esac
54 livecd_write_net_conf
55
56 echo "Type \"ifconfig\" to make sure the interface was configured correctly."
57
58 # vim: ts=4

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20