2011-03-30 13:53:33 +00:00
|
|
|
#!/bin/rc
|
|
|
|
|
|
|
|
# prereq: mountfs
|
|
|
|
# desc: download or continue to download the distribution archives
|
|
|
|
|
|
|
|
switch($1) {
|
|
|
|
case checkready
|
|
|
|
devs=(`{cat /net/ipifc/*/status >[2]/dev/null |
|
|
|
|
grep -v '127\.0\.0\.1' |
|
|
|
|
sed 's/ .*//'})
|
|
|
|
if(~ $#devs 0) {
|
|
|
|
download=notdone
|
|
|
|
export download
|
|
|
|
}
|
|
|
|
if(~ $mountdist done){
|
|
|
|
download=notdone
|
|
|
|
export download
|
|
|
|
}
|
|
|
|
|
|
|
|
case go
|
|
|
|
# BUG make restartable
|
|
|
|
echo 'Downloading distribution package...'
|
|
|
|
baropt='-w 145,129,445,168'
|
|
|
|
if(~ $textinst 1)
|
|
|
|
baropt=-t
|
2011-05-02 03:01:52 +00:00
|
|
|
mkdir -p /n/newfs/dist
|
|
|
|
if(! hget -vo /n/newfs/dist/_9front.iso.bz2 $installurl/9front.iso.bz2 |[2] aux/statusbar $baropt 'downloading '^9front.iso.bz2)
|
2011-03-30 13:53:33 +00:00
|
|
|
exit
|
2011-05-02 03:01:52 +00:00
|
|
|
mv /n/newfs/dist/_9front.iso.bz2 /n/newfs/dist/9front.iso.bz2
|
2011-03-30 13:53:33 +00:00
|
|
|
|
|
|
|
echo 'The distribution is downloaded.'
|
|
|
|
|
|
|
|
srvmedia=()
|
2011-05-02 03:01:52 +00:00
|
|
|
mountmedia=(mount /srv/cwfs /n/distmedia)
|
2011-03-30 13:53:33 +00:00
|
|
|
distmediadir=/dist
|
|
|
|
export distmediadir mountmedia distmedia
|
|
|
|
|
|
|
|
case checkdone
|
2011-05-02 03:01:52 +00:00
|
|
|
if(! test -f /n/newfs/dist/9front.iso.bz2) {
|
2011-03-30 13:53:33 +00:00
|
|
|
download=notdone
|
|
|
|
export download
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|