2011-06-12 08:15:50 +00:00
|
|
|
#!/bin/rc
|
|
|
|
|
|
|
|
# desc: setup network configuration
|
|
|
|
# prereq: confignet copydist
|
|
|
|
|
2017-08-05 12:30:48 +00:00
|
|
|
etheraddr=`{cat $netdev/addr >[2]/dev/null}
|
2011-06-14 11:43:59 +00:00
|
|
|
|
2011-06-12 08:15:50 +00:00
|
|
|
switch($1){
|
2011-06-14 11:43:59 +00:00
|
|
|
case checkready checkdone
|
2018-08-15 19:39:30 +00:00
|
|
|
if(~ $#etheraddr 1 && ~ $netisfrom ether && ~ $ethermethod automatic manual && \
|
2011-06-14 11:43:59 +00:00
|
|
|
! grep -s $etheraddr /n/newfs/lib/ndb/local)
|
2011-06-12 08:15:50 +00:00
|
|
|
ndbsetup=ready
|
2011-06-14 11:43:59 +00:00
|
|
|
if not
|
|
|
|
ndbsetup=done
|
|
|
|
export ndbsetup
|
2011-06-12 08:15:50 +00:00
|
|
|
|
|
|
|
case go
|
|
|
|
echo
|
|
|
|
echo 'Setup network configuration'
|
|
|
|
echo
|
|
|
|
|
|
|
|
default=()
|
|
|
|
if(~ $#sysname 1)
|
|
|
|
default=(-d $sysname)
|
|
|
|
prompt $default 'sysname'
|
|
|
|
sysname=$rd
|
|
|
|
|
2013-06-01 14:14:53 +00:00
|
|
|
cp /n/newfs/lib/ndb/local /tmp/ndb.local
|
2011-06-12 08:15:50 +00:00
|
|
|
{
|
2013-06-01 14:14:53 +00:00
|
|
|
ssam 'x/^.*ether='^$etheraddr^'.*$/ d' /tmp/ndb.local
|
2017-05-01 20:50:16 +00:00
|
|
|
|
|
|
|
se = ('sys='^$sysname 'ether='^$etheraddr)
|
2013-06-01 14:14:53 +00:00
|
|
|
|
2011-06-12 08:15:50 +00:00
|
|
|
echo
|
|
|
|
switch($ethermethod){
|
2018-08-15 19:39:30 +00:00
|
|
|
case automatic
|
2017-05-01 20:50:16 +00:00
|
|
|
echo $se
|
2011-06-12 08:15:50 +00:00
|
|
|
case manual
|
2017-05-01 20:50:16 +00:00
|
|
|
echo $se 'ip='^$ipaddr 'ipmask='^$ipmask 'ipgw='^$gwaddr
|
|
|
|
if(! ~ $#DNSSERVER 0){
|
|
|
|
echo ' ' 'dns='^$DNSSERVER
|
|
|
|
}
|
2011-06-12 08:15:50 +00:00
|
|
|
}
|
|
|
|
echo
|
2013-06-01 14:14:53 +00:00
|
|
|
} >/n/newfs/lib/ndb/local
|
2011-06-12 08:15:50 +00:00
|
|
|
}
|