shithub: riscv

ref: 3b376b43af24f8013d330eb2eb9c3b78849bb7c3
dir: /rc/bin/inst/startether/

View raw version
#!/bin/rc

# desc: activate ethernet card
# prereq: configether

switch($1) {
case checkready
	if(isipdevup $netdev) {
		startether=done
		export startether
	}

case go
	if(isipdevup $netdev)
		exit

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

case checkdone
	if(! isipdevup $netdev) {
		startether=notdone
		export startether
	}
}