]> git.lizzy.rs Git - plan9front.git/commitdiff
inst/ndbsetup: allow setting sysname more than once
authorcinap_lenrek <cinap_lenrek@gmx.de>
Sat, 1 Jun 2013 14:14:53 +0000 (16:14 +0200)
committercinap_lenrek <cinap_lenrek@gmx.de>
Sat, 1 Jun 2013 14:14:53 +0000 (16:14 +0200)
In the installation, if you run the ndbsetup task n times (n > 1),
the installed /lib/ndb/local will have n sys= entries.

The problem is that ndb(8) will use the first sys= entry found, but
one would expect that the last configuration in the ndbsetup task
would be the active one.

Remove any previous entry in ndbsetup before adding new one.

rc/bin/inst/ndbsetup

index fecf4aed2d6dee0d30349c9e67d72faa732ce4cc..ad795d9e51955ac1ba53712b58c8f82cd625288d 100755 (executable)
@@ -25,7 +25,10 @@ case go
        prompt $default 'sysname'
        sysname=$rd
 
+       cp /n/newfs/lib/ndb/local /tmp/ndb.local
        {
+               ssam 'x/^.*ether='^$etheraddr^'.*$/ d' /tmp/ndb.local
+
                echo
                switch($ethermethod){
                case dhcp
@@ -36,5 +39,5 @@ case go
                                'ip='^$ipaddr 'ipmask='^$ipmask 'ipgw='^$gwaddr
                }
                echo
-       } >>/n/newfs/lib/ndb/local
+       } >/n/newfs/lib/ndb/local
 }