summaryrefslogtreecommitdiff
path: root/rc/bin/inst/ndbsetup
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-06-12 08:15:50 +0000
committercinap_lenrek <cinap_lenrek@centraldogma>2011-06-12 08:15:50 +0000
commitc5bcd17a58cb16e9376ad7ddba6828c7287c8466 (patch)
tree33bf132612b32d5fc067c2cb9aa1f9f940566c56 /rc/bin/inst/ndbsetup
parentaeb62668546acd1c467a1190cf8a3c03a7b098e5 (diff)
inst: add network configuration setup
Diffstat (limited to 'rc/bin/inst/ndbsetup')
-rwxr-xr-xrc/bin/inst/ndbsetup44
1 files changed, 44 insertions, 0 deletions
diff --git a/rc/bin/inst/ndbsetup b/rc/bin/inst/ndbsetup
new file mode 100755
index 000000000..0ab4e8250
--- /dev/null
+++ b/rc/bin/inst/ndbsetup
@@ -0,0 +1,44 @@
+#!/bin/rc
+
+# desc: setup network configuration
+# prereq: confignet copydist
+
+switch($1){
+case checkready chekdone
+ if(! ~ $netisfrom ether || \
+ grep -s `{cat /net/ether0/addr} /n/newfs/lib/ndb/local){
+ ndbsetup=done
+ export ndbsetup
+ exit
+ }
+ if(~ $netisfrom ether && test -w /n/newfs/lib/ndb/local && \
+ test -r /net/ether0/addr){
+ ndbsetup=ready
+ export ndbsetup
+ exit
+ }
+
+case go
+ echo
+ echo 'Setup network configuration'
+ echo
+
+ default=()
+ if(~ $#sysname 1)
+ default=(-d $sysname)
+ prompt $default 'sysname'
+ sysname=$rd
+
+ {
+ echo
+ switch($ethermethod){
+ case dhcp
+ echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr}
+
+ case manual
+ echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr} \
+ 'ip='^$ipaddr 'ipmask='^$ipmask 'ipgw='^$gwaddr
+ }
+ echo
+ } >>/n/newfs/lib/ndb/local
+}