shithub: riscv

ref: a31e4f61a4c9afb9696a7ff4ff09e02b3281a2f3
dir: /sys/src/9/boot/tcp.rc/

View raw version
#!/bin/rc

fn configtcp{
	must ip/ipconfig -p $*
	
	if(~ $#fs 0)
		fs=`{awk -F'=' '/fs=/{print $2; exit}' /net/ndb}
	if(~ $#auth 0)
		auth=`{awk -F'=' '/auth=/{print $2; exit}' /net/ndb}
	if(~ $#fs 0)
		ask fs ' ip is?' $auth
	if(~ $#auth 0)
		ask auth ' ip is?' $fs
	
	fsaddr=tcp!$fs!564
	authaddr=tcp!$auth!567
}

fn connecttcp{
	srv -q $"fsaddr boot 
}

mtcp=(configtcp connecttcp)
mt=(mtcp $mt)