From c5bcd17a58cb16e9376ad7ddba6828c7287c8466 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 12 Jun 2011 08:15:50 +0000 Subject: inst: add network configuration setup --- rc/bin/inst/ndbsetup | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 rc/bin/inst/ndbsetup (limited to 'rc/bin/inst/ndbsetup') 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 +} -- cgit v1.2.3