summaryrefslogtreecommitdiff
path: root/rc/bin/inst/startether
blob: 077504c1ad13b53dee808295237adba674a3289b (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
#!/bin/rc

# desc: activate ethernet card
# prereq: configether

switch($1) {
case checkready
	if(isipdevup /net/ether0) {
		startether=done
		export startether
	}

case go
	if(isipdevup /net/ether0)
		exit

	log starting ethernet $ethermethod config
	switch($ethermethod) {
	case manual
		ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log
	case dhcp
		ip/ipconfig $dhcphost -D >>/srv/log >[2=1]
	}

case checkdone
	if(! isipdevup /net/ether0) {
		startether=notdone
		export startether
	}
}