summaryrefslogtreecommitdiff
blob: f20d4c7f4e0ad17231a83b2307ab66f10d5b2045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash

if [ -f /sbin/livecd-functions.sh ]
then
	source /sbin/livecd-functions.sh
else
	echo "ERROR: /sbin/livecd-functions.sh could not be loaded!"
	exit 1
fi

if [ ! -x $(which dialog) ]
then
	echo "ERROR: The dialog utility is required for net-setup.  Exiting!"
	exit 1
fi

livecd_check_root || exit 1

# Hide any potential error messages from the readlink/dirname/etc calls below
exec 2>/dev/null

if [ -z "${1}" ]
then
	show_ifmenu
	echo $iface
else
	iface="${1}"
fi

[ ! -d /tmp/setup.opts ] && mkdir -p /tmp/setup.opts
cd /tmp/setup.opts

while true; do
	show_ifconfirm $iface
	[[ $result == "yes" ]] && break
	show_ifmenu
done

# Show stderr again
exec 2>/dev/stderr

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
WIRED_WIRELESS=$(tail -n 1 ${iface}.WIRED_WIRELESS)
case ${WIRED_WIRELESS} in
	1)
		livecd_config_wireless
		livecd_config_ip
		livecd_write_wireless_conf
		;;
	2)
		livecd_config_ip
		;;
esac
livecd_write_net_conf

echo "Type \"ifconfig\" to make sure the interface was configured correctly."

# vim: ts=4