shithub: riscv

ref: 94e26e7576fabcaacd8fa8f75c4f87f9eb6e56f3
dir: /rc/bin/inst/startether/

View raw version
#!/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 >>[2]/srv/log
	}

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