diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-05-10 19:38:01 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-05-10 19:38:01 +0200 |
| commit | fcb974af3a3b9747083b618fb6be7a4e70df3201 (patch) | |
| tree | 9929998eeee52bb92659ec1ec2ae8677be02ceb8 /rc/bin/cpurc | |
| parent | 0e5888a0cf993c89e4d52fd80b07990993e5abac (diff) | |
| parent | eb3951bcd48399d4d7239a9d396a113e95e38be9 (diff) | |
| download | plan9front-fcb974af3a3b9747083b618fb6be7a4e70df3201.tar.xz | |
merge
Diffstat (limited to 'rc/bin/cpurc')
| -rwxr-xr-x | rc/bin/cpurc | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/rc/bin/cpurc b/rc/bin/cpurc index a410d3dcb..404f494ff 100755 --- a/rc/bin/cpurc +++ b/rc/bin/cpurc @@ -5,7 +5,7 @@ NPROC=`{wc -l </dev/sysstat} # bind all likely devices -for(i in t S P '$') +for(i in u t S P '$') bind -a '#'^$i /dev >/dev/null >[2=1] rm -f /env/i @@ -56,12 +56,19 @@ if(test -e /cfg/$sysname/cpurc) # automatic ip address setup if(test -r /net/ipselftab){ if(! grep u /net/ipselftab | grep -sv 127.0.0.1){ - ether=`{ndb/query sys $sysname ether} - if(~ $#ether 1){ - # try /lib/ndb first, then do dhcp - ip/ipconfig -N >[2]/dev/null || ip/ipconfig -h $sysname + addrs=`{ndb/query -a sys $sysname ether} + if(! ~ $#addrs 0){ + for(ether in /net/ether*){ + addr=`{cat $ether/addr} + switch($addr){ + case $addrs + # try /lib/ndb first, then do dhcp + ip/ipconfig -N ether $ether >[2]/dev/null \ + || ip/ipconfig -h $sysname ether $ether + } + } } - rm -f /env/ether + rm -f /env/ether /env/addrs /env/addr } } @@ -77,16 +84,16 @@ if(! ps|grep -s timesync){ sleep 2 } -if(~ $#auth 0){ - auth=`{ndb/query sys $sysname auth} - . <{ndb/ipquery sys $sysname auth | sed 's, +,\n,g'} -} if(test -d /cfg/$sysname/service) serviced=/cfg/$sysname/service if not if(test -d /cfg/default/service) serviced=/cfg/default/service if not serviced=/rc/bin/service +if(~ $#auth 0){ + auth=`{ndb/query sys $sysname auth} + . <{ndb/ipquery sys $sysname auth | sed 's, +,\n,g'} +} switch($auth){ case `{ echo $sysname; ndb/query sys $sysname dom if(test -r /net/ipselftab){ |
