]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/inst/download
inst/configfs: change spaces into tabs
[plan9front.git] / rc / bin / inst / download
1 #!/bin/rc
2
3 # prereq: mountfs
4 # desc: download or continue to download the distribution archives
5
6 switch($1) {
7 case checkready
8         devs=(`{cat /net/ipifc/*/status >[2]/dev/null |
9                 grep -v '127\.0\.0\.1' |
10                 sed 's/ .*//'})
11         if(~ $#devs 0) {
12                 download=notdone
13                 export download
14         }
15         if(~ $mountdist done){
16                 download=notdone
17                 export download
18         }
19
20 case go
21         # BUG make restartable
22         echo 'Downloading distribution package...'
23         baropt='-w 145,129,445,168'
24         if(~ $textinst 1)
25                 baropt=-t
26         mkdir -p /n/newfs/dist
27         if(! hget -vo /n/newfs/dist/_9front.iso.bz2 $installurl/9front.iso.bz2 |[2] aux/statusbar $baropt 'downloading '^9front.iso.bz2)
28                         exit
29         mv /n/newfs/dist/_9front.iso.bz2 /n/newfs/dist/9front.iso.bz2
30
31         echo 'The distribution is downloaded.'
32
33         srvmedia=()
34         mountmedia=(mount /srv/cwfs /n/distmedia)
35         distmediadir=/dist
36         export distmediadir mountmedia distmedia
37         
38 case checkdone
39         if(! test -f /n/newfs/dist/9front.iso.bz2) {
40                 download=notdone
41                 export download
42         }
43 }
44