]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/inst/configether
inst: get rid of ppp configuration
[plan9front.git] / rc / bin / inst / configether
1 #!/bin/rc
2
3 # desc: configure your internet connection via an ethernet card
4
5 switch($1) {
6 case go
7         echo
8         echo 'Please choose a method for configuring your ethernet connection.'
9         echo
10         echo '  manual - specify IP address, network mask, gateway IP address'
11         echo '  dhcp - use DHCP to automatically configure'
12         echo
13         
14         prompt -d dhcp 'Configuration method' manual dhcp
15         ethermethod=$rd
16         gwaddr=xxx
17         ipaddr=xxx
18         ipmask=xxx
19         if(~ $ethermethod manual){
20                 prompt 'ip address'; ipaddr=$rd
21                 prompt 'network mask'; ipmask=$rd
22                 prompt 'gateway address'; gwaddr=$rd
23                 export ipaddr ipmask gwaddr
24                 if(~ $#DNSSERVER 0){
25                         prompt -d $gwaddr 'dns server'; DNSSERVER=$rd
26                         export DNSSERVER
27                 }
28         }
29         export ethermethod gwaddr ipaddr ipmask dhcphost
30         exec ./startether go
31
32 case checkdone
33         if(! ~ $ethermethod manual dhcp) {
34                 configether=notdone
35                 export configether
36         }
37         if(~ $ethermethod manual && ~ 0 $#ipaddr $#ipmask $#gwaddr) {
38                 configether=notdone
39                 export configether
40         }
41 }