shithub: riscv

Download patch

ref: d6fa8c317513d560ac0f305fdb36007fdc1844f2
parent: 8b87e14b390e3da82d69b62f6cca2025b7ca18a4
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Tue Jun 14 09:43:59 EDT 2011

inst/ndbsetup: s/chekdone/checkdone/, simplify

--- a/rc/bin/inst/ndbsetup
+++ b/rc/bin/inst/ndbsetup
@@ -3,20 +3,16 @@
 # desc: setup network configuration
 # prereq: confignet copydist
 
+etheraddr=`{cat /net/ether0/addr >[2]/dev/null}
+
 switch($1){
-case checkready chekdone
-	if(! ~ $netisfrom ether || \
-		grep -s `{cat /net/ether0/addr} /n/newfs/lib/ndb/local){
-		ndbsetup=done
-		export ndbsetup
-		exit
-	}
-	if(~ $netisfrom ether && test -w /n/newfs/lib/ndb/local && \
-		test -r /net/ether0/addr){
+case checkready checkdone
+	if(~ $#etheraddr 1 && ~ $netisfrom ether && ~ $ethermethod dhcp manual && \
+	   ! grep -s $etheraddr /n/newfs/lib/ndb/local)
 		ndbsetup=ready
-		export ndbsetup
-		exit
-	}
+	if not
+		ndbsetup=done
+	export ndbsetup
 
 case go
 	echo
@@ -33,10 +29,10 @@
 		echo
 		switch($ethermethod){
 		case dhcp
-			echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr}
+			echo 'sys='^$sysname 'ether='^$etheraddr
 
 		case manual
-			echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr} \
+			echo 'sys='^$sysname 'ether='^$etheraddr \
 				'ip='^$ipaddr 'ipmask='^$ipmask 'ipgw='^$gwaddr
 		}
 		echo