termrc/cpurc: dont run ipconfig if theres no /net/ipselftab, dont run dns resolver if theres already /net/dns
This commit is contained in:
parent
c00a72a02d
commit
fe60a74122
2 changed files with 22 additions and 19 deletions
23
rc/bin/cpurc
23
rc/bin/cpurc
|
@ -17,31 +17,32 @@ mntgen -s slashn && chmod 666 /srv/slashn
|
||||||
# name translation, cs sets /dev/sysname
|
# name translation, cs sets /dev/sysname
|
||||||
ndb/cs
|
ndb/cs
|
||||||
sysname=`{cat /dev/sysname}
|
sysname=`{cat /dev/sysname}
|
||||||
|
|
||||||
# parallelism for mk
|
|
||||||
NPROC = `{wc -l </dev/sysstat}
|
|
||||||
|
|
||||||
if (~ $#sysname 0 || ~ $sysname ''){
|
if (~ $#sysname 0 || ~ $sysname ''){
|
||||||
sysname=cirno # default
|
sysname=cirno # default
|
||||||
echo -n $sysname >/dev/sysname
|
echo -n $sysname >/dev/sysname
|
||||||
}
|
}
|
||||||
prompt=($sysname^'# ' ' ')
|
prompt=($sysname^'# ' ' ')
|
||||||
|
|
||||||
|
# parallelism for mk
|
||||||
|
NPROC=`{wc -l </dev/sysstat}
|
||||||
|
|
||||||
# cpu-specific startup
|
# cpu-specific startup
|
||||||
if(test -e /cfg/$sysname/cpurc)
|
if(test -e /cfg/$sysname/cpurc)
|
||||||
. /cfg/$sysname/cpurc
|
. /cfg/$sysname/cpurc
|
||||||
|
|
||||||
# automatic ip address setup
|
# automatic ip address setup
|
||||||
if(! grep u /net/ipselftab | grep -sv 127.0.0.1){
|
if(test -r /net/ipselftab){
|
||||||
ether=`{ndb/query sys $sysname ether}
|
if(! grep u /net/ipselftab | grep -sv 127.0.0.1){
|
||||||
if(~ $#ether 1){
|
ether=`{ndb/query sys $sysname ether}
|
||||||
# try /lib/ndb first, then do dhcp
|
if(~ $#ether 1){
|
||||||
ip/ipconfig -N >[2]/dev/null || ip/ipconfig
|
# 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
|
ndb/dns -r
|
||||||
|
|
||||||
if(! ps|grep -s timesync){
|
if(! ps|grep -s timesync){
|
||||||
|
|
|
@ -32,23 +32,25 @@ if(~ $#sysname 0 || ~ $sysname ''){
|
||||||
}
|
}
|
||||||
|
|
||||||
# parallelism for mk
|
# parallelism for mk
|
||||||
NPROC = `{wc -l </dev/sysstat}
|
NPROC=`{wc -l </dev/sysstat}
|
||||||
|
|
||||||
# machine specific startup (e.g., for devices not probed)
|
# machine specific startup (e.g., for devices not probed)
|
||||||
if(test -e /cfg/$sysname/termrc)
|
if(test -e /cfg/$sysname/termrc)
|
||||||
. /cfg/$sysname/termrc
|
. /cfg/$sysname/termrc
|
||||||
|
|
||||||
# automatic ip address setup
|
# automatic ip address setup
|
||||||
if(! grep u /net/ipselftab | grep -sv 127.0.0.1){
|
if(test -r /net/ipselftab){
|
||||||
ether=`{ndb/query sys $sysname ether}
|
if(! grep u /net/ipselftab | grep -sv 127.0.0.1){
|
||||||
if(~ $#ether 1){
|
ether=`{ndb/query sys $sysname ether}
|
||||||
# try /lib/ndb first, then do dhcp
|
if(~ $#ether 1){
|
||||||
ip/ipconfig -N >[2]/dev/null || ip/ipconfig
|
# 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
|
ndb/dns -r
|
||||||
|
|
||||||
if(! ~ $terminal *vx32*){
|
if(! ~ $terminal *vx32*){
|
||||||
|
|
Loading…
Reference in a new issue