]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/inst/nvramsetup
fix * case
[plan9front.git] / rc / bin / inst / nvramsetup
1 #!/bin/rc
2
3 # desc: invalidate nvram
4 # prereq: systype copydist
5
6 files=()
7 for(i in /dev/sd*/nvram){
8         if(test -f $i)
9                 files=($files $i)
10 }
11
12 switch($1){
13 case checkdone checkready
14         if(~ $#files 0 && ! ~ $syst cpu)
15                 nvramsetup=done
16         if not {
17                 if(~ $#nvram 1 && grep -s trust $nvram)
18                         nvramsetup=done
19                 if not
20                         nvramsetup=ready
21         }
22         export nvramsetup
23
24 case go
25         echo
26         echo 'Setup Plan 9 NVRAM configuration partition (nvram)'
27         echo
28
29         if(~ $#files 1)
30                 default=(-d $files)
31         if not
32                 default=()
33         prompt $default 'Nvram partition' $files
34         nvram=$rd
35         export nvram
36
37         echo 'trust, but verify' >$nvram
38
39         if(! ~ $syst cpu)
40                 exit
41
42         echo
43         echo 'You will be asked to enter an authid, authdom, secstore key,'
44         echo 'and password upon next boot. The authid is the hostowner.'
45         echo 'The authdom is the domain from your network configuration.'
46         echo 'The secstore key and password should be a secret password'
47         echo 'of eight characters or greater in length. On an auth server,'
48         echo 'the password will be used to encrypt the user database'
49         echo '/adm/keys'
50         echo
51 }