X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=rc%2Fbin%2Finst%2Fndbsetup;h=fecf4aed2d6dee0d30349c9e67d72faa732ce4cc;hb=4c4a3cbfd47cda7286ea52035f1486985c7996d0;hp=0ab4e8250a846b5729c4564e24355ab41e8a4d32;hpb=c5bcd17a58cb16e9376ad7ddba6828c7287c8466;p=plan9front.git diff --git a/rc/bin/inst/ndbsetup b/rc/bin/inst/ndbsetup index 0ab4e8250..fecf4aed2 100755 --- 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 @@ case go 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