# 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
prompt $default 'sysname'
sysname=$rd
+ cp /n/newfs/lib/ndb/local /tmp/ndb.local
{
+ ssam 'x/^.*ether='^$etheraddr^'.*$/ d' /tmp/ndb.local
+
+ se = ('sys='^$sysname 'ether='^$etheraddr)
+
echo
switch($ethermethod){
case dhcp
- echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr}
-
+ echo $se
case manual
- echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr} \
- 'ip='^$ipaddr 'ipmask='^$ipmask 'ipgw='^$gwaddr
+ echo $se 'ip='^$ipaddr 'ipmask='^$ipmask 'ipgw='^$gwaddr
+ if(! ~ $#DNSSERVER 0){
+ echo ' ' 'dns='^$DNSSERVER
+ }
}
echo
- } >>/n/newfs/lib/ndb/local
+ } >/n/newfs/lib/ndb/local
}