shithub: riscv

ref: caddc9a6ea0c8aeb2510ec9eda67eb4f2e82a00c
dir: /rc/bin/inst/confignet/

View raw version
#!/bin/rc

# desc: configure the network

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

case go
	if(! test -d /net/ether0 >[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
}