use sysname as dhcp host

This commit is contained in:
cinap_lenrek 2012-03-29 18:23:21 +02:00
parent 9cb700018a
commit f000760ec0
4 changed files with 4 additions and 20 deletions

View file

@ -44,7 +44,7 @@ if(test -r /net/ipselftab){
ether=`{ndb/query sys $sysname ether} ether=`{ndb/query sys $sysname ether}
if(~ $#ether 1){ if(~ $#ether 1){
# try /lib/ndb first, then do dhcp # try /lib/ndb first, then do dhcp
ip/ipconfig -N >[2]/dev/null || ip/ipconfig ip/ipconfig -N >[2]/dev/null || ip/ipconfig -h $sysname
} }
rm -f /env/ether rm -f /env/ether
} }

View file

@ -16,28 +16,12 @@ case go
gwaddr=xxx gwaddr=xxx
ipaddr=xxx ipaddr=xxx
ipmask=xxx ipmask=xxx
switch($ethermethod){ if(~ $ethermethod manual){
case dhcp
echo
echo 'Some ISPs, notably @HOME, require a host name passed with DHCP'
echo 'requests. An example for @HOME would be "cc1018221-a". If your'
echo 'ISP supplied you such a name, enter it.'
echo
prompt -d none 'dhcp host name'; dhcphost=$rd
switch($dhcphost){
case none
dhcphost=();
case *
dhcphost=(-h $dhcphost)
}
export dhcphost
case manual
prompt 'ip address'; ipaddr=$rd prompt 'ip address'; ipaddr=$rd
prompt 'network mask'; ipmask=$rd prompt 'network mask'; ipmask=$rd
prompt 'gateway address'; gwaddr=$rd prompt 'gateway address'; gwaddr=$rd
export ipaddr ipmask gwaddr export ipaddr ipmask gwaddr
} }
export ethermethod gwaddr ipaddr ipmask dhcphost export ethermethod gwaddr ipaddr ipmask dhcphost
exec startether go exec startether go

View file

@ -19,7 +19,7 @@ case go
case manual case manual
ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log
case dhcp case dhcp
ip/ipconfig $dhcphost >>[2]/srv/log ip/ipconfig >>[2]/srv/log
} }
case checkdone case checkdone

View file

@ -53,7 +53,7 @@ if(test -r /net/ipselftab){
ether=`{ndb/query sys $sysname ether} ether=`{ndb/query sys $sysname ether}
if(~ $#ether 1){ if(~ $#ether 1){
# try /lib/ndb first, then do dhcp # try /lib/ndb first, then do dhcp
ip/ipconfig -N >[2]/dev/null || ip/ipconfig ip/ipconfig -N >[2]/dev/null || ip/ipconfig -h $sysname
} }
rm -f /env/ether rm -f /env/ether
} }