shithub: riscv

ref: 435a0f18d5a5f372b4d5a30953e8d6bfd9cf6d17
dir: /rc/bin/inst/confignet/

View raw version
#!/bin/rc

# desc: configure the network

switch($1){
case checkready checkdone
	netdev=/net/ether*
	netdev=$netdev(1)
	if(~ $netisfrom none){
		netdev=/dev/null
		confignet=done
		export confignet netdev
		exit
	}
	if(~ $netisfrom ether){
		x=config$netisfrom
		$x=done
		./config$netisfrom checkdone
		confignet=$$x
		export confignet netdev
		exit
	}
	confignet=ready
	export confignet netdev
	exit

case go
	if(! test -d $netdev >[2]/dev/null){
		echo
		echo 'Could not find ethernet card.'
		echo
		netisfrom=none
		export netisfrom
		exit
	}
	echo
	echo 'We will configure the ethernet.'
	echo
	netisfrom=ether
	export netisfrom
	exec ./configether go
}