2011-03-30 13:53:33 +00:00
|
|
|
#!/bin/rc
|
|
|
|
|
|
|
|
# desc: configure your internet connection via an ethernet card
|
|
|
|
|
|
|
|
switch($1) {
|
|
|
|
case go
|
|
|
|
echo
|
|
|
|
echo 'Please choose a method for configuring your ethernet connection.'
|
|
|
|
echo
|
|
|
|
echo ' manual - specify IP address, network mask, gateway IP address'
|
2018-08-15 19:39:30 +00:00
|
|
|
echo ' automatic - use DHCP and SLAAC to automatically configure'
|
2011-03-30 13:53:33 +00:00
|
|
|
echo
|
|
|
|
|
2018-08-15 19:39:30 +00:00
|
|
|
prompt -d automatic 'Configuration method' manual automatic
|
2011-03-30 13:53:33 +00:00
|
|
|
ethermethod=$rd
|
|
|
|
gwaddr=xxx
|
|
|
|
ipaddr=xxx
|
|
|
|
ipmask=xxx
|
2012-03-29 16:23:21 +00:00
|
|
|
if(~ $ethermethod manual){
|
2011-03-30 13:53:33 +00:00
|
|
|
prompt 'ip address'; ipaddr=$rd
|
|
|
|
prompt 'network mask'; ipmask=$rd
|
|
|
|
prompt 'gateway address'; gwaddr=$rd
|
|
|
|
export ipaddr ipmask gwaddr
|
2017-05-01 20:50:16 +00:00
|
|
|
if(~ $#DNSSERVER 0){
|
|
|
|
prompt -d $gwaddr 'dns server'; DNSSERVER=$rd
|
|
|
|
export DNSSERVER
|
|
|
|
}
|
2011-03-30 13:53:33 +00:00
|
|
|
}
|
2018-08-15 19:39:30 +00:00
|
|
|
export ethermethod gwaddr ipaddr ipmask
|
2013-10-26 18:17:56 +00:00
|
|
|
exec ./startether go
|
2011-03-30 13:53:33 +00:00
|
|
|
|
|
|
|
case checkdone
|
2018-08-15 19:39:30 +00:00
|
|
|
if(! ~ $ethermethod manual automatic) {
|
2011-03-30 13:53:33 +00:00
|
|
|
configether=notdone
|
|
|
|
export configether
|
|
|
|
}
|
|
|
|
if(~ $ethermethod manual && ~ 0 $#ipaddr $#ipmask $#gwaddr) {
|
|
|
|
configether=notdone
|
|
|
|
export configether
|
|
|
|
}
|
|
|
|
}
|