termrc/cpurc: dont run ipconfig if theres no /net/ipselftab, dont run dns resolver if theres already /net/dns

This commit is contained in:
cinap_lenrek 2011-10-07 21:02:45 +02:00
parent c00a72a02d
commit fe60a74122
2 changed files with 22 additions and 19 deletions

View file

@ -17,31 +17,32 @@ mntgen -s slashn && chmod 666 /srv/slashn
# name translation, cs sets /dev/sysname
ndb/cs
sysname=`{cat /dev/sysname}
# parallelism for mk
NPROC = `{wc -l </dev/sysstat}
if (~ $#sysname 0 || ~ $sysname ''){
sysname=cirno # default
echo -n $sysname >/dev/sysname
}
prompt=($sysname^'# ' ' ')
# parallelism for mk
NPROC=`{wc -l </dev/sysstat}
# cpu-specific startup
if(test -e /cfg/$sysname/cpurc)
. /cfg/$sysname/cpurc
# automatic ip address setup
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
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
}
rm -f /env/ether
}
rm -f /env/ether
}
if(! test -e /srv/dns)
if(! test -e /net/dns)
ndb/dns -r
if(! ps|grep -s timesync){

View file

@ -32,23 +32,25 @@ if(~ $#sysname 0 || ~ $sysname ''){
}
# parallelism for mk
NPROC = `{wc -l </dev/sysstat}
NPROC=`{wc -l </dev/sysstat}
# machine specific startup (e.g., for devices not probed)
if(test -e /cfg/$sysname/termrc)
. /cfg/$sysname/termrc
# automatic ip address setup
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
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
}
rm -f /env/ether
}
rm -f /env/ether
}
if(! test -e /srv/dns)
if(! test -e /net/dns)
ndb/dns -r
if(! ~ $terminal *vx32*){